Last active
September 25, 2018 11:28
-
-
Save AlexBrasileiro/49375e107365121a316bafc5e6e5477d to your computer and use it in GitHub Desktop.
React Native | Android Backbutton HOC
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't see any reason of using HOC or wrapping any content into into this, it does not add anything to wrapped content. So in my opinion better implementation would be something like this.
Abstract button, that does not require using react-router or any other routing library. With it you are able to specify custom actions for back button.
Using with react-router, just put it anywhere you want this behavior
<HistoryBackButton />
.I didn't run this code, so its more like pseudo code. :)