vercel / react-tweet

Embed tweets in your React application.

Home Page:https://react-tweet.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

weired tweet.user is undefined

mawnir opened this issue · comments

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?