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

Access a variable in react-typescript

$
0
0

I am learning react-typescript,

Code -

import {phones} from "../../get_phone";interface IProps {    phone: phones,}const Query1: React.FC <IProps> = ({phone}) => {    console.log(phone)        const [model, setmodel] = useState(phone);    console.log(model);}

Is it possible to access the model variable from other Components and also from other typescript files?

Thanks


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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