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

107
Views
Uso correcto del método unmountApplicationComponentAtRootTag en el componente ReactNative AppRegistry

Im tring para cargar dinámicamente un componente de reacción sin usar el comportamiento de renderizado nativo de reacción predeterminado.

 import React, {Component} from 'react'; import {Text, Button, RootTagContext} from 'react-native'; class App extends Component { static contextType = RootTagContext; constructor(props) { super(props); this.state = {change: true}; this.onclick = this.onclick.bind(this); } onclick() { this.orchestrator.dispatch({type: 'LOGIN_SUCCESS', rootTag: this.context}); } render() { return ( <Text> MicroApp 1 <Button onPress={this.onclick} title="Learn More" color="#841584" accessibilityLabel="Learn more about this purple button" /> </Text> ); } } export default App;

El siguiente fragmento de código desmontará la vista de la pantalla y generará un nuevo componente.

 if (rootTag == 0) AppRegistry.registerComponent(config, () => apps[id]); else { AppRegistry.unmountApplicationComponentAtRootTag(rootTag); AppRegistry.registerComponent(config, () => apps[id]); }

pero mientras ejecuto la otra parte, obtengo el siguiente error.

ingrese la descripción de la imagen aquí

¿Estoy usando la forma correcta de unmountApplicationComponentAtRootTag ? ¿Alguien puede ayudarme a resolver este problema?

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