import React, { useState } from 'react'; import { storiesOf } from '@storybook/react'; import StoryFixture from './StoryFixture'; import Fade from './transitions/CSSFade'; function ToggleFixture({ defaultIn, description, children }) { const [show, setShow] = useState(defaultIn || false); return ( { setShow(!show); }} > Toggle {React.cloneElement(children, { in: show })} ); } storiesOf('CSSTransition', module) .add('Fade', () => ( asaghasg asgasg )) .add('Fade with appear', () => ( asaghasg asgasg )) .add('Fade with mountOnEnter', () => { return ( Fade with mountOnEnter ); }) .add('Fade with unmountOnExit', () => { return ( Fade with unmountOnExit ); });