Reputation: 59
My use case is to reload the app on the click on a button so that a lot of properties can be redefined after that click. Is there a way we can reload a react native app via code?
Thanks!
Upvotes: 3
Views: 988
Reputation: 3727
I suggest using redux to easily manage states. This way, you can easily reload state.
Upvotes: 0
Reputation: 6833
This is a huge workaround – but it is saving a lot of time and avoiding the frustration of not shaking correctly.
We just throw 'Want to reload?
to prompt the error screen while in development, so we can hit refresh.
EDIT: If you want only to "reload" a button and its properties, you only need to rerender the parent component (if props are what you want to change), else, just change the state of the components, following normal react development.
Upvotes: 2