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

Possibly the object is 'null'

$
0
0

I'm getting the following Typescript errors in my code
I'm getting these parameters from a previous screen. As in the example of the react nativigation documentation.https://reactnavigation.org/docs/params/

interface PixChargeAmountProps {  route?: string;}const Amount: React.FC<PixChargeAmountProps> = ({ route }) => {const { trackOriginFlow } = route.params;}

console.log(route) ->

"params": {"trackOriginFlow": "ACTIVITIES_SCREEN_BUTTON"}, "path": undefined}

I get the following errors from route.params

route = Possibly the object is 'null'

params = Property 'params' does not exist in type 'string'


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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