Remove Window Even Listener When display:none

My component has successfully added a event listener to the window, and it works beautifully, but now if the display property gets set to false the listener remains on the window. I have

componentWillUnmount() {
  window.removeEventListener("keydown", this.handleKeyDown);

but I am guessing the component does not unmount when the props.display is set to false. How would I go about removing or maybe stopping my listener when the display prop is set to false? Maybe I can some how bind the display prop to the component props so that I will know inside the handleKeyDown if the component is being displayed.