Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6581

React-Native with Expo: Shows "Cannot find module 'xxx' or its corresponding type declarations." when importing a custom constant view

$
0
0

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?


Viewing all articles
Browse latest Browse all 6581

Latest Images

Trending Articles



Latest Images