Open starlight-akouri opened 8 months ago
to solve this problem all you do is
npm install @types/react
add this on the tsconfig.json
"paths": { "react": ["./node_modules/@types/react"], }
Hi, I have the same error with vitejs, ts, react
Have you tried my solution?
Have you tried my solution?
thank you it's fixed
This is also not working for me. My app is Next/React/TS. Error: My tsconfig, and package.json respectively:
my tsconfig.json
package.json
I've tried on couple project and it works to me
I am also having this issue. Did exactly what you did above.
@sepehr500 is that help you or not?
@sepehr500 is that help you or not?
Unfortunately it didn't help
I was able to find a quick fix, was getting the same error trying to use the AddressAutofill component in a react/typescript project.
I believe because the AddressAutofill component doesn't have a type definition, typescript won't allow you to use it.
I created a declarations.d.ts
file in my /src folder and added :
declare module "@mapbox/search-js-react" { export const AddressAutofill: React.FC<any>; // Adjust types if more specific ones are available }
hopefully this helps anyone.