Where to place logic for loading initial server data in React app?

前端 未结 2 670
青春惊慌失措
青春惊慌失措 2021-01-18 13:42

I am using React-Redux to build an application.

To load initial data for a React smart component, I need to dispatch a Redux action where the server data r

2条回答
  •  长发绾君心
    2021-01-18 14:07

    The recommended way is, I believe, to do it in componentDidMount. See this for more info.

提交回复
热议问题