There's moreā€¦

In usual web development, you use cookies or possibly local storage for access information, but in a React application, storing the token (or whatever you use) in the state is good enough. If you need to provide the token for API calls, remember that actions are defined as follows:

const anActionCreator = 
(...parameters...) =>
(dispatch, getState) =>
{ ...your action... }

So, you can access the token via the getState() function, and pass it back to the server as needed; go back to the getRegions2() code, where we saw how to do async actions, to see an example of using this function.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.153.38