I would like to open a Dialog or Modal if I get a status 401 in AUTH_ERROR. What is the best way to implement this.
Thanks!
I would like to open a Dialog or Modal if I get a status 401 in AUTH_ERROR. What is the best way to implement this.
Thanks!
Copyright © 2021 Jogjafile Inc.
You'll have to take the custom app route:
Follow the documentation to bootstrap your custom app.
Add a saga which should take the latest (
takeLatestin redux-saga)FETCH_ERRORaction. This action has anerrorproperty. The saga should then dispatch (putin redux-saga) a custom action which will be used by a reducer you'll add.This reducer should contain the data required for the modal: at least a boolean determining whether to show it or not.
Finally, update your custom app by adding it a custom redux connected component which will check if it has to show your modal.