reason-react-hacker-news icon indicating copy to clipboard operation
reason-react-hacker-news copied to clipboard

Memory Leak?

Open mikecann opened this issue 6 years ago • 0 comments

Hey,

Im very new to Reason so was just looking through this codebase trying to learn real-world examples of how to do things and I came across this line:

https://github.com/reasonml-community/reason-react-hacker-news/blob/master/src/TopStoriesPage.re#L49

Im wondering if this is a memory leak because it doesnt get un-listened when the component unmounts?

It might explain this console error you get when running locally:

main.js:3176 Warning: Can't call setState (or forceUpdate) 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. in TopStoriesPage (created by App)

Im submitting this is an issue rather than doing a PR because im very new so no doubt im missing something here. Ill happily attempt a PR if this is indeed an issue.

mikecann avatar Nov 11 '18 04:11 mikecann