如何在Next.js中使用自定义钩子Next.js并防止did not match server/client错误而不使用useEffect()?例如,当使用swr时。useData()将数据存储在客户端(context + localStorage)。我试图用用户提供的一些数据创建一个静态站点。</div>
return <div>Data {data.foobar}<
我需要使用上下文提供程序,当我试图使用上下文时,它告诉我NavContext' is not defined no-undef。NavContext.Provider>}//then in one of the child I'm trying to call it:
import { useContext/context/NavContext' //