Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

108
Visualizações
Correct usage of unmountApplicationComponentAtRootTag method in ReactNative AppRegistry component

Im tring to dynamically load a react component without using default react-native rendering behavior.

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;

following code snippet will unmount the view from the screen and render new component.

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

but while executing the else part, im getting following error.

enter image description here

Am i using the unmountApplicationComponentAtRootTag correct way? Can anyone can help me to resolve this problem?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda