RSSAmplifier

sometechblog.com · Oct 5, 2020

Lightweight and flexible React hook to animate height change

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

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 *…

Read on /posts/height-animation-hook/

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.