Hiding or showing a element with React is as simple as an if statement deciding whether to print it or not. However often you want to be able to animate the transition, so that it smoothly closes or opens. To avoid cluttering the various components with this animation logic, extract the logic into a hook: /** * Returns the variables needed to animate a open and close functionality via height * @param {Boolean} isOpen: boolean is the element initially open * @param {Number} duration: number du...