Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
El objeto de ruta de React Native Navigator no está definido

¿Por qué recibo un error de que la route no está undefined en mi componente React Native Navigator? Pensé que estaba presionando la información correcta, pero supongo que no. Cualquier ayuda sería apreciada. Estoy acostumbrado a trabajar con la web, por lo que React Native es todo un cambio.

Asi que...

Quiero navegar desde mi componente SplashContainer a mi componente SignUpForm . Así que en SplashContainer hago esto...

 class SplashContainer extends Component { handleLoginFinished = () => { this.props.dispatch(handleAuthWithFirebase()) } handleToSignUp = () => { this.props.navigator.push({ signUpForm: true }); } handleToSignIn = () => { this.props.navigator.push({ signIn: true }) } render () { return ( <Splash onLoginFinished={this.handleLoginFinished} goToSignUp={this.handleToSignUp} goToSignIn={this.handleToSignIn} /> ) } } export default connect()(SplashContainer)

Luego, en React Native Navigator hago esto...

 export default class NimbusNavigator extends Component { static propTypes = { isAuthed: PropTypes.bool.isRequired } renderScene = (route, navigator) => { // Keeps track of whether user is Authed or not. if (this.props.isAuthed === false) { return <SplashContainer navigator={navigator}/> } else if (route.signUpForm === true) { return <SignUpForm navigator={navigator}/> } return <FooterTabsContainer navigator={navigator} /> } configureScene = (route) => { } render () { return ( <Navigator configureScene={this.configureScene} renderScene={this.renderScene} /> ) } }
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

La ruta no está definida al inicio porque no le dio al Navigator ninguna ruta inicial . Desea configurar cualquiera de los accesorios initialRoute o initialRouteStack .

Suponiendo que desea comenzar en una ruta con el nombre HOME, aquí hay un ejemplo donde la ruta { name: 'HOME' } se define en línea:

 render () { return ( <Navigator initialRoute={{ name: 'HOME' }} configureScene={this.configureScene} renderScene={this.renderScene} /> ) }
over 4 years ago · Santiago Trujillo Report

0

Normalmente la navegación se configura así:

 handleToSignUp = () => { this.props.navigator.push({ name: 'signUpForm' }); }

//

 renderScene = (route, navigator) => { // Keeps track of whether user is Authed or not. if (this.props.isAuthed === false) { return <SplashContainer navigator={navigator}/> } else if (route.name === 'signUpForm') { return <SignUpForm navigator={navigator}/> } return <FooterTabsContainer navigator={navigator} /> }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!