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

TS lint firing errors when creating logic for passing data to a previous screen on react navigation

$
0
0

Below is a code snippet taken from the react-navigation documentation on how to pass data to a previous screen.

  React.useEffect(() => {    if (route.params?.post) {      // Post updated, do something with `route.params.post`      // For example, send the post to the server       console.log(route.params.post);    }  }, [route.params?.post]);

Everything works fine however I am getting the following error.

Property 'post' does not exist on type 'object'.

How do I remove this error ?


Viewing all articles
Browse latest Browse all 6211

Trending Articles



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