Use removeAllListeners on unmount
This commit is contained in:
1 parent
05ea9b3ce2
commit
0f92f3f87b
3 files changed
+3
-3
No files matched your search
+1
-1
@@ -13,7 +13,7 @@ export default class DatePickView extends Component {
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
bleedingDaysSortedByDate.removeListener(setStateWithCalendarFormattedDays)
|
||||
bleedingDaysSortedByDate.removeAllListeners()
|
||||
}
|
||||
|
||||
passDateToDayView(result) {
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ export default class DayView extends Component {
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
bleedingDaysSortedByDate.removeListener(setStateWithCurrentCycleDayNumber)
|
||||
bleedingDaysSortedByDate.removeAllListeners()
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Reference in new issue
Block a user