Open
Description
Now that react supports hooks you might add one to this project e.g. like this:
const myButton = ({isVisible}) => {
const {ref, className} = useCssTransitionGroup({in: isVisible, classNames: 'button'});
return <button className={className} ref={ref}>Click me</button>;
}
This would allow people to wrap the library hook with a special behaviour based on their project requirements like this:
const useSlideIn = ({in}) => useCssTransitionGroup({in, classNames: 'slide'});
or
const useSlideIn = ({in}) => useCssTransitionGroup({onEnter: () => /* special slide logic */, in, classNames: 'slide'})
And then reuse such a transition effect multiple times in the project:
const Component1 = () => {
const {ref, className} = useSlideIn({in});
return <div ref={ref} className={className}>...</div>
}