diff --git a/nest_frontend/components/interactive/BoxRepositoryTweets.js b/nest_frontend/components/interactive/BoxRepositoryTweets.js index 822cba7..953bfd5 100644 --- a/nest_frontend/components/interactive/BoxRepositoryTweets.js +++ b/nest_frontend/components/interactive/BoxRepositoryTweets.js @@ -1,4 +1,4 @@ -import React from "react" +import React, { useMemo } from "react" import BoxFullScrollable from "../base/BoxFullScrollable" import SummaryTweet from "./SummaryTweet" import Empty from "./Empty" @@ -18,13 +18,18 @@ export default function BoxRepositoryTweets({ ...props }) { const strings = useStrings() const { tweets } = useRepositoryViewer() - let content - if(tweets.length === 0) { - content = - } - else { - content = tweets.map(tweet => ) - } + const content = useMemo( + () => { + if(tweets.length === 0) { + return + } + else { + return tweets.map(tweet => ) + } + }, + [tweets] + ) + return (