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

306
Views
Router.js: 135 TypeError no detectado: no se pueden leer las propiedades de undefined (leyendo 'estilo') en React Native

Soy nuevo en React Native. Estoy tratando de usar el enrutador de 'react-native-router-flux'. Pero tengo este error:

 Router.js:135 Uncaught TypeError: Cannot read properties of undefined (reading 'style') at Module../node_modules/react-native-router-flux/src/Router.js (Router.js:135) at __webpack_require__ (bootstrap:789) at fn (bootstrap:100) at Module../node_modules/react-native-router-flux/src/index.js (index.js:1) at __webpack_require__ (bootstrap:789)

Mi aplicación.js:

 import { createNativeStackNavigator } from '@react-navigation/native-stack'; import { Router, Scene } from 'react-native-router-flux'; export default function App() { return ( <View style={styles.container}> <Router> <Scene key="root"> <Scene key="Home" component={Home} title="Home" initial /> <Scene key="Forgotpassword" component={Forgotpassword} title="Forgotpassword" /> </Scene> </Router> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', paddingTop: Constants.statusBarHeight, backgroundColor: '#ecf0f1', padding: 8, } });

Mi paquete.json:

 "dependencies": { "@react-navigation/native": "^6.0.10", "@react-navigation/native-stack": "^6.6.2", "expo": "~45.0.0", "expo-status-bar": "~1.3.0", "react": "17.0.2", "react-dom": "17.0.2", "react-native": "0.68.2", "react-native-paper": "^4.12.1", "react-native-router-flux": "^4.3.1", "react-native-safe-area-context": "^4.2.4", "react-native-screens": "~3.11.1", "react-native-web": "0.17.7" },

Editar: anteriormente olvidé agregar estilos en mi pregunta. Ahora lo agregué a mi pregunta. Disculpe las molestias.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Le dio a su 'vista' un estilo de 'styles.container' pero no puedo ver en ninguna parte de su código donde definió 'estilos'. Puede agregar estilos personalizados a su Vista usando el siguiente código:

 const styles = Stylesheet.create({ // Write the styles here similar to CSS but in camelcase })

Recuerde importar Stylesheet desde react-native en su módulo. Si ya ha definido la hoja de estilo en su código. Por favor incluya eso en su pregunta.

about 4 years ago · Juan Pablo Isaza 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!