acdlite / acdlite/redux-router

ReduxRouter does not remove hashchange-listener on unmount

Abierto
#132 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
JavaScript
Estrellas
2.3k
Forks
194
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

When unmounting an React-app with ReactDOM.unmountComponentAtNode() the hashchange-listener of createHistory is not removed. It is added by the history.listen call in client.js, but the returned unlisten-function is not stored and never called.
Somehow the unlisten function needs to get called in ReduxRouter.componentWillUnmount().

As a quickfix, I added the unlisten-function to the returned store of historySynchronization() and called it from ReduxRouter.componentWillUnmount, but I guess thats not the best way to do it...

Thx for your help!

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

The issue is in client.js where history.listen is called, but the returned unlisten function is not stored. Examine ReduxRouter.componentWillUnmount to see where to call it. Look at the historySynchronization function to understand how the store and history are connected. A fix involves storing the unlisten function and ensuring it's called on unmount.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, react, redux
Área
frontend
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.