Repository navigation
Upgrading caused type mismatch in react types #332
Description
Activity
- addedGitHubIssues that have been added to our internal issue tracker.Issues that have been added to our internal issue tracker.
on Apr 8, 2022 Ref: INT-2848
I got this issue and managed to solved it. In my case, my local machine is using
npmand my docker is usingyarn. I changed my docker script to use npm and also upgrade my local machine node version from 14 to 16.
Hope it does give you some clues.Hello @dellasys, i try with node 16.14.2 but same error.
Hello, same issue here. I have tried to update node but same error. Do you know other workaround? Thank you
Have you tried delete node_modules and
npm install?Yes, after moving from yarn to npm it is now working. Thank you!
This problem occurs if you haven't migrated to the newest version of React. The solution is to tell your package manager to enforce the same versions of
@types/reactand@types/react-dompackages, in all dependencies that require them.In the case of npm you have to add the following properties to
package.json:"scripts": { "preinstall": "npm install --package-lock-only --ignore-scripts && npx npm-force-resolutions", }, "resolutions": { "@types/react": "17.0.6", "@types/react-dom": "17.0.5" }Reacted by Bulala-liuAnother possibility is that the
yarn.lockorpackage-lock.jsonneeds to be regenerated because multiple versions of the react libraries and types are being included.In the case of
yarnI would normally fix this sort of problem by deleting thenode_modulesfolder andyarn.lockfile followed by re-runningyarn installto regenerate both.I don't believe this is an actual problem with the tinymce-react repository though so I will convert this issue into a discussion so people can still see it.
- changed the title
[-]TSX error[/-][+]Upgrading caused type mismatch in react types[/+]on Aug 1, 2022 - locked and limited conversation to collaborators
on Aug 1, 2022
Hello, I have one error with Editor component.
Type error: 'Editor' cannot be used as a JSX component.
Its instance type 'Editor' is not a valid JSX element.
The types returned by 'render()' are incompatible between these types.
Type 'ReactElement<{ ref: RefObject; id: string; }, string | JSXElementConstructor>' is not assignable to type 'ReactNode'.
Property 'children' is missing in type 'ReactElement<{ ref: RefObject; id: string; }, string | JSXElementConstructor>' but required in type 'ReactPortal'.
Thank for futur help.