'How should I clear the Relay JS store when logging out?
I'm using react-relay v12.
When logging out, should I create a new relay environment (rather than e.g. clearing the store somehow)? I have been doing just that, but I'm now having problems because the Relay environment in the RelayEnvironmentProvider context is not updated. In theory I could manually update this using a hook, but this is difficult in certain places (e.g. relay network middleware, state containers)
The easiest solution seems to be to avoid creating a new store and instead clear the old one. Is that possible? Or is there a better solution?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
