Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Expected behavior for render#wrapper
  • Loading branch information
eps1lon committed Oct 3, 2021
commit 1510e805dc2fb83633c1d1bff51b13f16e92a259
4 changes: 3 additions & 1 deletion types/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ export function wrappedRenderB(
ui: React.ReactElement,
options?: pure.RenderOptions,
) {
const Wrapper: React.FunctionComponent = ({children}) => {
const Wrapper: React.FunctionComponent<{children?: React.ReactNode}> = ({
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While FunctionComponent adds implicit children, its propTypes do not so we didn't catch that issue. Here we make sure all statics assume the same props. Also makes sure this doesn't break once we get rid of implicit children in React.FunctionComponent.

children,
}) => {
return <div>{children}</div>
}

Expand Down