Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset state action #70

Open
brentvatne opened this issue Dec 5, 2018 · 2 comments
Open

Reset state action #70

brentvatne opened this issue Dec 5, 2018 · 2 comments

Comments

@brentvatne
Copy link
Member

Reset as a way to dispatch actions is a bit clunky. If we just let people reset the state to exactly what they want, that seems both more powerful and easier to use. For example, see: react-navigation/react-navigation#5338

@brentvatne
Copy link
Member Author

I think we should expose an action called dangerouslyResetState that allows users to have full control over what the state will be set to. The reason we would want to include 'dangerously' in the name is because you should be sure that you need to do this, you are directly manipulating the state of the router and if you make a mistake it could cause your app to crash or something.

@brentvatne
Copy link
Member Author

brentvatne commented Dec 7, 2018

example of something similar using getStateForAction https://snack.expo.io/@notbrent/reset-state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant