TS2786: 'Helmet' cannot be used as a JSX component
See original GitHub issueHelmet works in JSX but not in Typescript, I am getting:
TS2786: 'Helmet' cannot be used as a JSX component
Type 'Helmet' is missing the following properties from type 'ElementClass':
render, context, setState, forceUpdate
import { Helmet } from 'react-helmet';
return (
<>
<Helmet>
<title>
{translation('supportPage.heading')}
</title>
</Helmet>
<Breadcrumbs />
...
</>
);
react@17.0.1
react-helmet@6.1.0
@types/react-helmet@6.1.1 (devDependencies)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:12
- Comments:13
Top Results From Across the Web
Helmet is not a valid jsx element - reactjs
i have this problem in the react boilerplate template. typsecript error 'Helmet' cannot be used as a ...
Read more >ts2786: 'provider' cannot be used as a jsx component.
Getting TS2786 for Helmet and HelmetProvider when setting up a new project. ERROR in internals/startingTemplate/src/app/components/NotFoundPage/index ...
Read more >[Solved]-Helmet is not a valid jsx element-Reactjs
[Solved]-Helmet is not a valid jsx element-Reactjs. Search. score:24. Accepted answer. I was able to resolve this by installing @types/react-helmet.
Read more >Component cannot be used as a JSX component in React
The error Component cannot be used as a JSX component occurs for multiple reasons, returning an array of JSX elements instead of a...
Read more >DevExtreme component cannot be used as a JSX ...
'Button' cannot be used as a JSX component. Its instance type 'Button' is not a valid JSX element. The types returned by 'render()'...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
+1 Similar issue with react 18
also experiencing issues with this once upgrading to react-18