Types are incompatible with React 18
See original GitHub issueDescribe the bug Using the package in react 18 is giving the error of children not mentioned in the props
To Reproduce Steps to reproduce the behavior including code snippet (if applies):
- Create a Sample File using React 18
- Try to Run the app
- See error
'(props: DocumentProps | Readonly<DocumentProps>): Document', gave the following error. Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Document> & Readonly<DocumentProps>'. Overload 2 of 2, '(props: DocumentProps, context: any): Document', gave the following error. Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<Document> & Readonly<DocumentProps>'.ts(2769)
@diegomura
I belive in react 18 you need to explicitly define the children props https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:13
Top GitHub Comments
if you want to use React18 , i use my little dirty helper this work, renaming helps to trick Typescript
Does anyone know when it will be compatible with React 18?