andreypopp / andreypopp/react-async

client bootstrapping json does not work correctly if page has multiple async components

未关闭
#44 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
JavaScript
星标
440
派生
24
PR 合并指标
30 天内没有已合并 PR

描述

I am rendering a component on the server. This component has three child components. Each of these child components call getInitialStateAsync. When the page is loaded on the browser, it looks like react async is trying to boostrap first child component with the json that was dumped by the server. However, the json that its attempting to load is from the third child component.

It looks like we can only safely call getInitialStateAsync once on the server. Calling it multiple times overrides the previous json dump. So in my case, each of the child components call getInitialStateAsync and their json dumps override the previous dump. So on the client, react-async is attempting to bootstrap the first child component with the third's json data. The remaining two child components do not get bootstrapped at all.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。