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

Property 'id' does not exist on type 'object'?

$
0
0

I'm trying to import a video ID using AWS Amplify's DataStore and the useRoute() hook from @react-navigation/native library.

So far everything is working, but I keep getting this error:

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

I tried searching on google and I kind of found some similar stuff, but none of the solutions would work for my app.

My code:

    const [video, setVideo] = useState<Video | null >(null)    const [comments, setComments] = useState<Comment[]>([])    const route = useRoute()    const videoId = route.params?.id    useEffect(() => {        DataStore.query(Video, videoId).then(setVideo)    }, [videoId])

Viewing all articles
Browse latest Browse all 6287

Trending Articles



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