CRA + TypeScript: Removing "react" imports not working in tests? ("React is not defined") #10183
-
Perhaps I am missing something, but if I remove all Is anyone else experiencing this issue (I will open up an actual GitHub issue if it is confirmed by others), or do I miss some reconfiguration required to make this work? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
My tests ran fine after upgrading to the new JSX transform. I used the following package versions: "@testing-library/react": "^11.2.2",
"@types/react": "^16.14.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-scripts": "^4.0.1",
"typescript": "^4.1.2" Are you missing an update to one of these perhaps? |
Beta Was this translation helpful? Give feedback.
-
Tried again, this time it worked as expected. Perhaps some dependencies were out of date, perhaps some were not yet ready. |
Beta Was this translation helpful? Give feedback.
Tried again, this time it worked as expected. Perhaps some dependencies were out of date, perhaps some were not yet ready.