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

285
Views
Advertencia: no se puede realizar una actualización de estado de React en un componente desmontado. Autenticación de base de fuego

Estoy usando Firebase y Expo para autenticar la información del usuario registrándome e iniciando sesión, cuando inicio sesión o registro no aparece ninguna advertencia, pero cuando salgo de la aplicación, devuelve la advertencia: Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method. Reduje el problema a estas tres pantallas. Probé con muchas correcciones sin resultados.

Aplicación.js

 let unsubscribe; export class App extends Component { constructor(props) { super(props); this.state = { loaded: false, }; } componentDidMount() { unsubscribe = auth.onAuthStateChanged((user) => { if (!user) { this.setState({ loaded: true }) this.setState({ loggedIn: false }) } else { this.setState({ loaded: true }) this.setState({ loggedIn: true }) } }) } componentWillUnmount() { unsubscribe() }

Cuenta.js

 export class Account extends React.Component { constructor(props) { super(props); this.state = { loaded: false, signedIn: false, modalVisible: false, } } onSignOut = () => { auth .signOut() }

Registro.js

 export class Register extends Component { constructor(props) { super(props); this.state = { email: '', password: '', phoneNumber: '', loaded: false } } componentDidMount() { this.setState({loaded: true}) } componentWillUnmount() { this.signUp() } singUp = async () => { const { phoneNumber, email, password } = this.state; const number = '+1' + phoneNumber try { const phoneProvider = new PhoneAuthProvider(auth); const verificationId = await phoneProvider.verifyPhoneNumber( number, recaptchaVerifier.current ); this.props.navigation.navigate('VerifyPhoneNumber', { verificationId: verificationId, phoneNumber: number, signInWithPhoneNumber: false, email: email, password: password }) } catch (err) { Alert.alert( 'Alert', `${err}` ) } }
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!