I
I
ikerya2020-09-09 14:58:07
React
ikerya, 2020-09-09 14:58:07

How to create temporary variables in Redux?

Hello. Prompt how to be in such situation:

1. Action - REQUEST_LOGIN is sent, there is an authorization request to the server.
2. A response with an error arrives, the error text is written to the store using a reducer.
3. When refreshing the page, the error text remains, as it was saved in the store

. How can I redo steps 1 and 2 to avoid the third?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kulakov, 2020-09-13
@Sqvall

Create a reducer that will keep track of something like CLEAN_LOGIN_ERROR or a generic CLEAN_ERROR, depending on how you have organized a store for these errors, and just call an action that will activate this reducer where you need it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question