-
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
There is no route defined for key key0. Must be one of: 'key3','< clone view key >' (nested scenes) #2439
Comments
Every scene needs a key. Try add key to scene within tabs(myitem, feed, saveditem) |
@joel611 that worked! Thanks so much! |
worked for me also! thanks! |
I just had to replace my |
@joel611 that worked! Thanks so much! |
I already have a key for all my scenes but still getting that error. |
I have same issue, this is my code: `
When I try: Actions.employeeList({ type: 'reset' }); |
@shamanking Same here. I used Actions.main or Actions.pop to resolve this. But I do want to know how to navigate to some scene like employeeList, not the direct sub-scene of the root scene. |
@chelseaisgood : Thank you. I call employeeList from Scene employeeCreate. In Scene employeeCreate, I call action like: `
}; If I try: Actions.employeeList({ type: 'reset' }); It has error. |
@shamanking Did you solve this issue ? |
I am also getting this error. There is no route defined for key key1. Must be one of: 'key2' Was working fine until I introduced the modal + the additional 'rootPrivate' scene as the docs detail for setting up the modal.
|
@abohannon try adding a key to your Modal View ? |
@shamanking @selvesandev I am facing the same issue. Any suggestions as to how to fix it? |
Try Action.pop() |
hello |
Hey guys, could you fork the project and make a broken version of the Example app with the same error? That would help me a lot to check it out with the short free time that I have to dedicate to this project lately. Thank you. |
Also, not sure if is the same error - so, please, open a new issue, and be sure to put all the possible information to make easier to reproduce this error. Thank you again. |
Same issue here. |
@shamanking @saurabhabh and anyone else who is having this problem, and is probably also doing Stephen Grider's React-Native course that this example seems to be from. You need to call try the following if the key is named main: `export const employeeSave = ({ name, phone, shift, uid }) => { return () => { or this if you just want to go back one; they both should have the same result: `export const employeeSave = ({ name, phone, shift, uid }) => { return () => { |
Thank you so much.
…On Wed, Jul 4, 2018, 4:32 AM jwilliamson1 ***@***.***> wrote:
@shamanking <https://github.com/shamanking> @saurabhabh
<https://github.com/saurabhabh> and anyone else who is having this
problem, and is probably also doing Stephen Grider's React-Native course
that this example seems to be from. You need to call Actions.pop() or
Actions.main(), to go back on instead of using Actions.employeeList({
type: 'reset' });.
try the following if the key is named main:
`export const employeeSave = ({ name, phone, shift, uid }) => {
const { currentUser } = firebase.auth();
return () => {
firebase.database().ref(/users/${currentUser.uid}/employees/${uid})
.set({ name, phone, shift })
.then(() => {
Actions.main();
});
};
};`
or this if you just want to go back one; they both should have the same
result:
`export const employeeSave = ({ name, phone, shift, uid }) => {
const { currentUser } = firebase.auth();
return () => {
firebase.database().ref(/users/${currentUser.uid}/employees/${uid})
.set({ name, phone, shift })
.then(() => {
Actions.pop();
});
};
};`
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2439 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AITZsaNeYCYWM_MoVTM-S2jdHxzOwE1jks5uC_gYgaJpZM4PksAU>
.
|
This is claimed to be required react-native-router-flex to prevent crashes. Hopefully fixes reported crashes with signature: "There is no route defined for key" Reference: aksonov/react-native-router-flux#2439
Version
Tell us which versions you are using:
Expected behaviour
I have my router set up like this:
When the app loads initially (with no persisted data), the scene of key
"welcome"
is loaded. A button on that component callsActions.selectItems()
, and navigates to the scene of key"selectItems"
.The component in
SelectItems
has a button that callsActions.main()
(as well as firing an action which setsuser.onboarded
to true).I'd expect that the scene of key
"main"
would load, which in turn would load it's initial scene,"tab2"
.Actual behaviour
When
Actions.main()
is called fromSelectItems
, an error is thrown:There is no route defined for key key0. Must be one of: 'key3','itemShow'
.However, if the app is reloaded (now that
this.props.user.onboarded
=true
, the app successfully loads to theFeed
component.Note: the reason I have nested the scenes within their tab scenes is that otherwise, when navigating to a clone view, the tab for the scene which you navigated from is replaced with a tab for the clone view (which is reproducible in the Example app by navigating to tab3 and then the echo view. tab3 will disappear).
Steps to reproduce
Please let me know if you need me to fork the example app.
Thanks!!
The text was updated successfully, but these errors were encountered: