React Server端渲染API调用的正确位置

时间:2019-02-12 14:42:27

标签: reactjs react-redux react-router reactive-programming ssr

我们正在使用ComponentWillMount()生命周期进行反应15中的API调用,以实现服务器端渲染。现在,我们要迁移应用程序以响应16.8,这是在服务器端渲染中调用API操作的理想位置吗?

1 个答案:

答案 0 :(得分:0)

ComponentDidMount()应该是您要寻找的。

PFB链接可为您提供更多帮助:where should i place my api call