Created
September 7, 2017 12:45
-
-
Save f0rr0/0488228d71e58ab92ce3d78375d40b91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const statusBarMiddleware = ({ getState }) => next => (action) => { | |
if (!Object.values(NavigationActions).includes(action.type)) { | |
return next(action) | |
} | |
const currentScreen = getCurrentRouteName(getState().rootNavigation) | |
const result = next(action) | |
const nextScreen = getCurrentRouteName(getState().rootNavigation) | |
if (nextScreen !== currentScreen && Platform.OS === 'ios') { | |
setStyleForRoute(nextScreen) | |
} | |
return result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment