- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
next-with-apollo
npm 库和 the approach shown in next.js docs 中选择的“next.js 中的 apollo-client”方法对比.
next.js 为 apollo 客户端选择的方法链接:https://github.com/vercel/next.js/blob/canary/examples/with-apollo/lib/apolloClient.js
next-with-apollo
方法的一些缺点
看到很多人都在使用 next-with-apollo
而很少看到 approach shown in next.js docs 的用法,这让我感到非常好奇?我很好奇 next.js 文档中的方法是否有任何缺点(我强烈认为没有任何缺点)?
那么,对于同时支持 CSR 和 SRR 的客户端数据抓取和服务器端数据抓取,哪个更好?
最佳答案
我通过在 next.js 社区发帖找到了答案:
这里是:
next.js doc's apollo examples avoid using getDataFromTree because it traverses the react tree twice in order to trigger all the queries and collect their result afterwards.
The drawback of using the approach on the next.js doc's apollo examples is since you don't use
getDataFromTree
, you have no way to know which queries your inner components are using. So you need to remember to prefetch everything you need ongetStaticProps
/getServerSideProps
and match the exact same queries/variablesnext.js doc's apollo examples way is recommended instead of
getInitialProps
so I would always use them unless one has some very specific reason not to
关于next.js - next.js 中的 apollo-client with `next-with-apollo` VS next.js 文档常见问题解答中显示的方法(不使用 `getDataFromTree` ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68848346/
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
是否了解线程的同步和异步? 线程同步:多个线程同时访问同一资源,等待资源访问结束,浪费时间,效率低 线程异步:在访问资源时在空闲等待时同时访问其他资源,实现多线程机制 是否了解网
常见问题 cat系统的定位 cat本质上一个实时监控系统,主要体现在监控报表Transaction、event、problem、heartbeat等,cat系统定制的监控模型以及定制的实时分
我正在使用PowerShell中的GUI并尝试制作表单,以便在构建表单之后,用户可以与表单的一部分(+/-按钮)进行交互,以向该表单动态添加一组控件现有集的下方。 例如,将有一个组合框(下拉菜单)用于
尝试读取/解析输入时,我的C程序出现问题。 救命? 这是一个常见问题解答条目。 StackOverflow有许多与读取C语言中的输入有关的问题,答案通常集中在特定用户的特定问题上,而没有真正描绘出整个
当我尝试读取/解析输入时,我的C程序出现问题。 救命? 这是一个常见问题解答条目。 StackOverflow有许多与读取C语言中的输入有关的问题,答案通常集中在特定用户的特定问题上,而没有真正描绘出
当我尝试读取/解析输入时,我的C程序出现问题。 救命? 这是一个常见问题解答条目。 StackOverflow有许多与读取C语言中的输入有关的问题,答案通常集中在特定用户的特定问题上,而没有真正描绘出
当我尝试读取/解析输入时,我的C程序出现问题。 救命? 这是一个常见问题解答条目。 StackOverflow有许多与读取C语言中的输入有关的问题,答案通常集中在特定用户的特定问题上,而没有真正描绘出
当我尝试读取/解析输入时,我的C程序出现问题。 救命? 这是一个常见问题解答条目。 StackOverflow有许多与读取C语言中的输入有关的问题,答案通常集中在特定用户的特定问题上,而没有真正描绘出
当我尝试读取/解析输入时,我的C程序出现问题。 救命? 这是一个常见问题解答条目。 StackOverflow有许多与读取C语言中的输入有关的问题,答案通常集中在特定用户的特定问题上,而没有真正描绘出
当我尝试读取/解析输入时,我的C程序出现问题。 救命? 这是一个常见问题解答条目。 StackOverflow有许多与读取C语言中的输入有关的问题,答案通常集中在特定用户的特定问题上,而没有真正描绘出
我不知道如何在 C++ 项目中使用 TDD,但我决定先使用“Google Mock Framework”。 但我有一个问题: 当我完成测试时,是否必须从 TDD 的宏、类等中清理我的代码? 换句话说,
我从 sourceForge 获得的这个源文件中有 26 个错误。它是 Stanford CS106B library 的一部分所以应该不会有任何错误。 错误示例: C2059:语法错误:'publi
处理现有的展开/折叠“FAQ” Accordion 页面并希望“展开/折叠”功能正常工作。 我设法让页面开始时所有内容都折叠起来,但是当我单击任何列展开然后单击另一列时,原始列不会折叠。 重要的是,我
可以从 MySQL 数据库获取“常见问题解答”。我有一个存储问题和答案的表。每天在我的网站上我们都会收到数千个问题。 现在我统计一下,我的数据库中有 142,283 个问题。我的想法是通过创建常见问题
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我有以下 html。它由 bootstrap 和 css url 文件组成。它有两个 Accordion 项目选项卡。但是打开的时候发现有javascript错误。当我单击 Accordion 时,它
我观看/阅读/搜索了许多教程,但都没有成功。我坚持 this tutorial . 我正在尝试将带有 JS(可能仅 CSS)的 toogle acordion 效果应用到 div 而不定位。 有两种显
我讨厌问这个问题,因为它已经被问了一百万次,但答案似乎从来都不令人满意,而且大多数线程似乎都没有得到公认的答案就被放弃了。 这正是我需要做的(由于业力低,恶意网址是故意的): http://examp
我正在使用 CRNA v0.44 。我正在进行两个屏幕注册。我在第一个屏幕上,现在我想使用 react 导航转到第二个屏幕。 但是出现错误: undefined is not an object (e
我是一名优秀的程序员,十分优秀!