因为您无权访问您的状态 Jan 28, 2024 10:57:38 GMT Quote Select PostDeselect PostLink to PostMemberGive GiftBack to Top Post by account_disabled on Jan 28, 2024 10:57:38 GMT 您可以访问的内容也受到限制——几乎只是请求对象;再说一次,这似乎是一个很好的做法,因为您无权访问您的状态,无论如何,这在您的服务器与客户端上都是不同的。哦,如果您之前没有注意到它,它只适用于顶级页面组件。 终极连接 Redux Connect是一个非常固执己见的服务器端渲染器,有着不错的理念,但如果您不使用他们描述的所有工具,这可能不适合您。这个包有很多内容,但它非常复杂,而且还没有升级到 React Router v4。这有很多设置,但让我们来看最重要的部分,只是为了吸取一些教训 装饰器在 JavaScript 中不是标准的。在撰写本文时,它们处于第 2 阶段,因此请酌情使用。这只是添加高阶组件的另一种方式。这个想法非常简单:关键 WhatsApp 号码数据 是传的 props 的内容,然后你有一个 Promise 列表,这些 Promise 会解析并传入。这看起来相当不错。也许替代方案就是这样 这对于 JavaScript 来说似乎是可行的,没有太多问题。 反应前载 React -frontload存储库没有大量文档或解释,但也许我能得到的最好理解是来自测试(例如这个) 和阅读源代码。当安装某些东西时,它会被添加到承诺队列中,当它解析时,它就会被提供。它所做的事情相当不错,尽管很难推荐一些没有很好记录、维护或使用的东西寻找更好的解决方案 上述解决方案都无法真正满足我对库的灵活性和简单性的期望,所以现在我将介绍我自己的实现。目标不是编写一个包,而是让您了解如何根据您的用例编写自己的包。 此示例解决方案的存储库位于此处。 理论 这背后的想法相对简单,尽管它最终只是相当多的代码。这是为了概述我们正在讨论的想法。