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

undefined is not an object (evaluating 'props.') React Native expo

$
0
0

I have been having a lot of problems with my npm packages in my React Native app, and thought that I had been able to solve most of them. However, when I try to navigate to any of my screens that use props or state, the app crashes with the following errors (or similar)

TypeError: undefined is not an object (evaluating 'state.')TypeError: undefined is not an object (evaluating 'props.')

Any idea how to fix this? I have tried updating my npm packages and cleaning them but to no luck.

The areas where the error is being highlighted are:

const someVariable = useSelector(    (state: any) => state.thing.thing);

Specifically the error is pointing to the useSelector part of that.

And also:

const isAuthenticated = useSelector(    (state: any) => state.auth.authenticated);

The error isn't pointed out specifically, but I assume it is also useSelector.

This has worked fine previously, it has only stopped working following updating and cleaning the packages.


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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