Closed nutboltu closed 5 years ago
https://github.com/flexdinesh/react-socks/blob/fdd4cc19960ac4d16bed8184f79b8c7fa69c1f0d/src/Breakpoint/BreakpointProvider.js#L30
In BreakpointProvider, the lodash debounce should be cancel on ComponentWillUnmount. Otherwise it will cause a memory leak when user resize the window and unmount the component within 100 ms (debounce delay time)
BreakpointProvider
ComponentWillUnmount
@nutboltu Can you explain with an example code? Would help if you could link to some resources explaining this.
@flexdinesh I opened a PR with the issue. It might help you to understand
https://github.com/flexdinesh/react-socks/blob/fdd4cc19960ac4d16bed8184f79b8c7fa69c1f0d/src/Breakpoint/BreakpointProvider.js#L30
In
BreakpointProvider
, the lodash debounce should be cancel onComponentWillUnmount
. Otherwise it will cause a memory leak when user resize the window and unmount the component within 100 ms (debounce delay time)