import React from 'react'; import { useEffect, useRef, useState } from '@storybook/client-api'; export default { title: 'Hooks', }; export const Checkbox = () => { const [on, setOn] = useState(false); return ( ); }; export const Input = () => { const [text, setText] = useState('foo'); return setText(e.target.value)} />; }; export const effect = () => { const ref = useRef(); useEffect(() => { if (ref.current != null) { ref.current.style.backgroundColor = 'yellow'; } }); return ( ); }; export const reactHookCheckbox = () => { const [on, setOn] = React.useState(false); return ( ); };