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 | […]

Categories
Development

Error with the type of my props when i import, Ts(2322)

Can someone help me? I am using TypeScript, StyledComponent and React with Create React App. This error occurred during the build time and cannot be dismissed. // browser and terminal error TypeScript error in ./src/index.tsx(4,1): Type ‘{ alt: string; src: string; }’ is not assignable to type ‘IntrinsicAttributes’. Property ‘alt’ does not exist on type […]