Last active
July 17, 2020 19:46
-
-
Save DZuz14/f65dd0c93c8f8d9d8aaf5d48cd055007 to your computer and use it in GitHub Desktop.
Accordion with React Children Scaffold
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Accordion = ({ children }) => { | |
// const [open, setOpen] = useState('') | |
// const handleOpen = (e) => { | |
// const id = e.target.getAttribute('data-id') | |
// id === open ? setOpen('') : setOpen(id) | |
// } | |
return ( | |
<div> | |
{React.Children.map(children, child => { | |
return <div></div> | |
})} | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment