Currently, I am working on a Nextjs project integrating React bootstrap. Everything was functioning smoothly until today when all of the React bootstrap components started throwing the same error, leading to build failures.
The 'Dropdown.Item' component cannot be used in JSX.
The return type 'ReactNode' is not a valid JSX element.ts(2786)
No modifications were made to the package.json
or any configuration files. Below are the dependencies related to React, Next, TypeScript, and React Bootstrap:
"@types/react": "18.0.30",
"@types/react-dom": "18.0.11",
"next": "13.2.4",
"react": "^18.2.0",
"react-bootstrap": "^2.7.2",
"react-dom": "18.2.0",
"typescript": "5.0.2",