Skip to content

Commit

Permalink
fix(login-page): fix render children parameter issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Apr 24, 2023
1 parent a51e552 commit 13cdded
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/Render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ export type RenderChildren =
| { children?: React.ReactNode };

export const Render: FC<RenderChildren> = ({ children }) => {
const { fields = {}, buttons = {}, extra = {}, blocks = {}, data } = useStore();
const { fields = {}, buttons = {}, extra = {}, $$index = {}, blocks = {}, data } = useStore();
const childs = typeof children === 'function' ? [] : Children.toArray(children);
return (
<Fragment>
{typeof children === 'function' && !isValidElement(children) && children({ fields, buttons, blocks, extra }, { ...data })}
{typeof children === 'function' && !isValidElement(children) && children({ fields, buttons, blocks, extra, $$index }, { ...data })}
{typeof children !== 'function' && childs.map((child, key) => {
if (!isValidElement(child)) return null;
return cloneElement(child, {
Expand Down

0 comments on commit 13cdded

Please sign in to comment.