I just cloned a TypeScript React-Native project at work and it is riddled with a variety of errors on my machine for some reason, the contractor who made the app isn't sure why. Here's a few examples of the errors.
import BackButton from "../assets/images/backbutton.png"; - Cannot find module or its corresponding type declarations. ts(2307)
const Title = ({ children }) => - Binding element 'children' implicitly has an 'any' type. ts(7031)
Here's my tsconfig.json:
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"jsx": "react-native",
"lib": [
"dom",
"esnext"
],
"moduleResolution": "node",
"noEmit": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"strict": true
},
"extends": "expo/tsconfig.base" - File 'expo/tsconfig.base' not found.enter code here
}
As you can see it seems like it some sort of configuration problem in regards to typescript. Any suggestions are appreciated.
Image has to be imported using require instead of import.
const backBtnImg = require('../assets/images/backbutton.png');