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

Expo cannot auto import React-native on Visual studio code in Typescript

$
0
0

I just start to learn the react-native with Expo SDK.I follow the official tutorial to init managed Typescript template.enter image description here

And I found that I can only import unique React-native component.enter image description here

Not the React-native component which has same name across Dom, React.enter image description here

I saw the node-modules already have the Types but not know why the auto-import not work.

This is what vscode try to find but not go through the React-native type definition.enter image description here

But React-native types has the type definition.enter image description here

If I import the Text manually from the React-native, it can get the correct definition.

import { Image, StyleSheet, Text, View } from 'react-native';enter image description here

Any help is appreciated.


Viewing all articles
Browse latest Browse all 6212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>