Categories
Mastering Development

JSX element type ‘Location’ is not a constructor function for JJSX elements

I’m building app by using react and typescript. “react”: “^16.12.0”, “typescript”: “^3.7.5”, “@types/react”: “^16.9.23” I want to call my react component like that: <Location location={location} setLocation={setLocation} /> but i get this error message: TS2605: JSX element type ‘Location’ is not a constructor function for JSX elements. ¬†¬†Type ‘Location’ is missing the following properties from type […]

Categories
Development

Why is this React Typescript app throwing errors?

I just created a new React app using npx create-react-app my-app –template typescript and it was working fine until I changed my component to from a stateless one to a stateful one. The error: JSX element type ‘App’ is not a constructor function for JSX elements. TS2605 3 | import App from “./App”; 4 | […]