如何避免在反应功能组件中不必要地重新渲染“静态组件”?

我有一个react功能组件,它显示标签和帖子列表以及一些静态文本/装饰。我使用useState钩子将当前选择的标签存储在一个状态中通过使用useQuery带有tag变量的阿波罗钩子来获取帖子用户应该能够选择一个标签,它将替换当前tag状态-因此useQuery(POSTS_QUERY)将使用新tag变量重新运行

const onTagSelectChange = (window: Window, 
    router: NextRouter, 
    name: string, 
    checked: boolean,
    tagSetter: React.Dispatch<React.SetStateAction<string>>) => {

    if (checked) {
        setTagQueryInUrl(window, router, name)
        tagSetter(name)
    } else {
        setTagQueryInUrl(window, router, null)
        tagSetter(null)
    }
}

const NewsList: NextPage = () => {

    const router = useRouter()
    const query = router.query as Query

    // store tag in state
    // initialize tag from `tag` query
    const [tag, setTag] = useState(query.tag)

    const { data: postsData, loading: postsLoading, error: postsError } = useQuery(
        POSTS_QUERY,
        {
            variables: {
                tag: tag
            }
        }
    )

    const { data: tagsData, loading: tagsLoading, error: tagsError } = useQuery(TAGS_QUERY)

    // show error page if either posts or tags query returned error
    if (postsError || tagsError) {
        return <Error statusCode={500} />
    }

    return (
        <div>
            <h1>Here we have list of news, and I should not re-render everytim :(</h1>
            <Tags
                loading={tagsLoading} 
                data={tagsData} 
                isChecked={(name) => name === tag} 
                onChange={(name, checked) => onTagSelectChange(window, router, name, checked, setTag)}
            />
            <Posts loading={postsLoading} data={postsData} />
        </div>
    )
}

我的问题是,h1即使我没有传递任何内容,为什么我的块仍继续渲染?还是我完全误解了反应的原理?

在这里我单击标签,它显示h1元素一直在重新渲染