title: React Flow possible null value with document.body.classList.add
body: <p>I have a react component where I change the html body class. The class is being added in componentDidMount and removed in componentWillUnmount. I am using Flow for type checking. When I run Flow I get the following error:</p>
  
  <pre><code>src/modules/homepage/HomePage.js:27
   27:         document.body.classList.remove('homepage')
                             ^^^^^^^^^ property `classList`. Property cannot be accessed on possibly null value
   27:         document.body.classList.remove('homepage')
               ^^^^^^^^^^^^^ null
  </code></pre>
  
  <p>Can anyone suggest how to suppress this error or what would be the recommended approach?</p>
  
  <p>Thank you</p>