Closed
Description
@testing-library/react
version: 12.1.1- Testing Framework and version: jest @ 27.2.2
- DOM Environment: 5.14.1
Relevant code or config:
type AppWrapperProps = {
userProviderProps?: UserProviderProps
}
export const AppWrapper: React.FC<AppWrapperProps> = ({
children,
userProviderProps = { user: mockUser },
}) => (
<UserProvider {...userProviderProps}>
...
What you did:
Upgraded @testing-library/react to 12.1.1
What happened:
Type for wrapper broken in #966
Reproduction:
Use wrapper component that has some props that can be passed
Problem description:
The type being inflexible (only allowing children
) means that the wrapper can't take props if used anywhere else
Suggested solution:
Something like wrapper?: React.ComponentType<React.PropsWithChildren>