vercel / react-tweet

Embed tweets in your React application.
https://react-tweet.vercel.app
MIT License
1.48k stars 82 forks source link

weired tweet.user is undefined #144

Open mawnir opened 7 months ago

mawnir commented 7 months ago

With this tweet id = '1716120243775402095' => "This Post is from an account that no longer exists" I get this error: 'TypeError: tweet.user is undefined'

my code:

const { data, error, isLoading } = useSWR('/api/tweets/' + tweetId, fetcher);

    if (isLoading) {
        return (<TweetSkeleton />)
    }
    else if (error) {
        return null// (<TweetNotFound />)
    } else {
        //console.log(data.data);
        if (data.data) {
            const tweet = enrichTweet(data.data);  <== Problem here 

how can i check this before hand?