I am relativity new to react/redux. There for I want to ask a (perhaps a philosophic) question.
Is it ok to to dispatch an action (e.g. to trigger an api-call) on
According to the official React documentation, componentDidMount
is exactly the right place to do so:
componentDidMount() is invoked immediately after a component is mounted. Initialization that requires DOM nodes should go here. If you need to load data from a remote endpoint, this is a good place to instantiate the network request.
— Official React Documentation for componentDidMount()