News for hackers. Stuff that matters.
Re:Simple React Patterns by pcmaffey on Friday November 10, 2017 @01:04PM (#15671684)
I use a static var on the class.

  componentDidMount() {
   if (!this.unmounted) ...
  }

  componentWillUnmount() {
   this.unmounted = true
  }
Re:Simple React Patterns by fatso83 on Saturday November 11, 2017 @05:43AM (#15675794)
That's not a static car on the class. It's on the instance! A static class property would entail something like `Foo.unmounted = true` (a bad idea).