简体   繁体   中英

'react-native' not importing correctly to page

As you can see in the photo, there are 3 dots under react-native. On other projects when I hover over it it says as follows:

module "/Users/mac/Library/Caches/typescript/4.5/node_modules/@types/react-native/index"

But when I hover over in this new project, it says as follows:

module "/Users/mac/Desktop/project/rn-zoom/node_modules/react-native/index"

I guess that's why when I type "Button", the automatic import option does not appear, or when I start typing props, the automatic import option does not appear. What causes this situation and how can I fix it?

在此处输入图像描述

Install Plugins:

React Native Tools & ES7 React/Redux/GraphQL/React-Native snippets

Now check that at your bottom right corner the selected language is React.

delete your node-module folder and run npm install it will work for you. and also run the command of clear cache.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2025 STACKOOM.COM