Skip to content

Commit

Permalink
fix: fix cr
Browse files Browse the repository at this point in the history
  • Loading branch information
anlyyao committed Aug 15, 2024
1 parent 11eb3ef commit eff98a4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/common/Portal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createPortal } from 'react-dom';
import { AttachNode, AttachNodeReturnValue } from '../common';
import { canUseDocument } from '../_util/dom';
import useConfig from '../hooks/useConfig';
import useDefaultProps from '../hooks/useDefaultProps';

export interface PortalProps {
/**
Expand Down Expand Up @@ -36,8 +37,9 @@ export function getAttach(attach: PortalProps['attach'], triggerNode?: HTMLEleme
return document.body;
}

const Portal = forwardRef((props: PortalProps, ref) => {
const { attach, children, triggerNode } = props;
const Portal = forwardRef<HTMLElement, PortalProps>((props, ref) => {
const { attach, children, triggerNode } = useDefaultProps<PortalProps>(props, {});

const { classPrefix } = useConfig();

const container = useMemo(() => {
Expand Down
3 changes: 2 additions & 1 deletion src/loading/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ export const LoadingPlugin: LoadingPluginMethod = (options) => {
loading: true,
attach: null,
fullscreen: !attach,
...props,
};

ReactDOM.render(<Loading {...defaultProps} {...props} attach={null}></Loading>, div);
ReactDOM.render(<Loading {...defaultProps} attach={null}></Loading>, div);

container.appendChild(div);

Expand Down

0 comments on commit eff98a4

Please sign in to comment.