-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Actions.currentScene is prefixed with an underscore for Scenes inside of Tabs #2802
Comments
It seems to be any of my scenes which are in <Router
backAndroidHandler={this.onBackPress}
sceneStyle={{
backgroundColor: `white`,
}}
>
<Scene hideNavBar panHandlers={null} key={`modal`} modal>
<Scene key={`root`} panHandlers={null} hideNavBar>
<Tabs
showLabel={false}
lazy={true}
tabBarStyle={styles.tabs}
tabBarPosition={`bottom`}
labelStyle={styles.label}
swipeEnabled={false}
>
<Scene
hideNavBar
key={MY_WATER_KEY}
onEnter={() => onEnter(MY_WATER_KEY)}
component={MyWater}
icon={({ focused }) => (
<TabbarTab
active={focused}
icon={`drop2`}
label={getLocalizedString(
`myWater.title`,
)}
/>
)}
/>
<Scene
hideNavBar
key={INBOX_KEY}
onEnter={() => onEnter(INBOX_KEY)}
component={Inbox}
icon={({ focused }) => (
<TabbarTab
active={focused}
icon={`envelope`}
label={getLocalizedString(
`inbox.title`,
)}
/>
)}
/>
<Scene
hideNavBar
key={MY_ACCOUNT_KEY}
onEnter={() => onEnter(MY_ACCOUNT_KEY)}
component={MyAccount}
icon={({ focused }) => (
<TabbarTab
active={focused}
icon={`home3`}
label={getLocalizedString(
`myAccount.title`,
)}
/>
)}
/>
</Tabs>
<Scene initial key={`initial`} component={Loader} />
<Scene
key={LOGIN_SCENE_KEY}
onEnter={() => onEnter(LOGIN_SCENE_KEY)}
component={Login}
/>
<Scene
key={FORGOT_PASSWORD_KEY}
onEnter={() => onEnter(FORGOT_PASSWORD_KEY)}
component={ForgotPassword}
/>
<Scene
hideNavBar
key={HOUSEHOLD_ATTRIBUTES_SET_UP_KEY}
onEnter={() =>
onEnter(HOUSEHOLD_ATTRIBUTES_SET_UP_KEY)
}
component={HouseholdSetUp}
/>
<Scene
hideNavBar
key={ENABLE_NOTIFICATIONS_KEY}
onEnter={() => onEnter(ENABLE_NOTIFICATIONS_KEY)}
component={EnableNotifications}
/>
<Scene
hideNavBar
key={COMPLETED_SET_UP_KEY}
onEnter={() => onEnter(COMPLETED_SET_UP_KEY)}
component={CompletedSetUp}
/>
<Scene
hideNavBar
key={UTILITY_PICKER_SCENE_KEY}
onEnter={() => onEnter(UTILITY_PICKER_SCENE_KEY)}
component={UtilityPicker}
/>
<Scene
hideNavBar
key={POKE_UTILITY_SCENE_KEY}
onEnter={() => onEnter(POKE_UTILITY_SCENE_KEY)}
component={PokeUtility}
/>
<Scene
hideNavBar
key={REGISTER_SCENE_KEY}
onEnter={() => onEnter(REGISTER_SCENE_KEY)}
component={Register}
/>
<Scene
hideNavBar
key={UTILITY_NOT_FOUND_SCENE_KEY}
onEnter={() => onEnter(UTILITY_NOT_FOUND_SCENE_KEY)}
component={UtilityNotFound}
/>
</Scene>
<Scene
key={PROFILE_KEY}
onEnter={() => onEnter(PROFILE_KEY)}
component={Profile}
/>
<Scene
key={TIPS_KEY}
onEnter={() => onEnter(TIPS_KEY)}
component={Tips}
/>
<Scene
key={REBATES_KEY}
onEnter={() => onEnter(REBATES_KEY)}
component={Rebates}
/>
<Scene
key={NOTIFICATION_SETTINGS_KEY}
onEnter={() => onEnter(NOTIFICATION_SETTINGS_KEY)}
component={NotificationSettings}
/>
<Scene
key={INBOX_MESSAGE_KEY}
onEnter={() => onEnter(INBOX_MESSAGE_KEY)}
component={InboxMessage}
/>
<Scene
key={SUPPORT_KEY}
onEnter={() => onEnter(SUPPORT_KEY)}
component={Support}
/>
</Scene>
</Router> |
@dwilt You probably need to have a key prop for Tab |
@Jun711 You had me really excited there but it didn't end up working. Any other ideas? |
I also tried wrapping each |
I was able to remove the underscore by setting |
Version
Tell us which versions you are using:
Expected behaviour
When I call
Actions.currentScene
, the value isn't prefixed with an undscore.Actual behaviour
When I am calling
Actions.currentScene
in my code, all of my scene keys are getting prefixed with a_
. For example, here is theActions
object that I'm inspecting in the debugger:Notice the
MY_WATER_KEY
function that is used for the route. Then notice the value ofcurrentScene
-_MY_WATER_KEY
. Why is this?The text was updated successfully, but these errors were encountered: