Closed DavyOnGit closed 2 years ago
I have the same issue with BrowserRouter
30 | <>
> 31 | <BrowserRouter>
| ^
32 | <Switch>
TS2786: 'Helmet' cannot be used as a JSX component. Its instance type 'Helmet' is not a valid JSX element. 7 | return ( 8 | <>
9 |
| ^^^^^^ 10 | 404 Page Not Found 11 | 12 |
Its because of the new breaking change in "@types/react v18" pfff... The quickest way is to update these libraries to the latest versions. Let me know if it works (just tested my self)
"@types/react": "18.0.2",
"@types/react-dom": "18.0.0",
"react-i18next": "11.16.5",
"react-helmet-async": "1.3.0",
That was it. Fix verified. Thanks @Can-Sahin.
Description
Getting TS2786 for Helmet and HelmetProvider when setting up a new project.
Steps to reproduce
I also tried running in a clean docker container to verify it wasn't my config.
Versions