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])