I created a React Native project with Expo.
I have the MainButton.tsx
file inside /components
folder like this:
import { View, Text } from "react-native";
const MainButton = () => {
return (
...
);
};
export default MainButton;
Now in the index.tsx
file in the app
folder I want to import this custom button like this:
import { MainButton } from "../components";
But it shows the error: Cannot find module '../components' or its corresponding type declarations.
How do I fix this? Should I modify the tsconfig.json
file?