react-tweet
react-tweet copied to clipboard
weired tweet.user is undefined
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?