Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

238
Vistas
Darse de baja no es un parámetro asignable

Estoy usando mecanografiado con reaccionar y estoy tratando de cancelar la suscripción de un observador de firestore. Funciona cuando lo uso en js pero no cuando lo uso en mecanografiado. ¿Cómo hago esto correctamente? Aquí está mi código

 const notifications = collection(db, USER_ID_STRING, 'dfgdfg', NOTIFICATIONS_STRING); const loadAlerts =useCallback( () => { const alertNotifcationsObserver = onSnapshot(notifications, (querySnapshot) => { const alertData: any[] = [] querySnapshot.forEach((doc) => { alertData.push({ ...doc.data(), }) }); setAlertNotifcations(alertData) }); return alertNotifcationsObserver },[notifications]) useEffect(() => { loadAlerts(); return ()=>loadAlerts() }, [loadAlerts]);

aquí está mi error

 Argument of type '() => () => Unsubscribe' is not assignable to parameter of type 'EffectCallback'. Type '() => Unsubscribe' is not assignable to type 'void | Destructor'. Type '() => Unsubscribe' is not assignable to type 'Destructor'. Type 'Unsubscribe' is not assignable to type 'void | { [UNDEFINED_VOID_ONLY]: never; }'. Property '[UNDEFINED_VOID_ONLY]' is missing in type 'Unsubscribe' but required in type '{ [UNDEFINED_VOID_ONLY]: never; }'.ts(2345) index.d.ts(58, 34): '[UNDEFINED_VOID_ONLY]' is declared here. board.tsx(69, 15): Did you mean to call this expression?
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda