Design comparison
Solution retrospective
There's nothing special about this challenge, but I did enjoy it. I've already tried most of the components on this project using vanilla JavaScript; I just need to recreate them with ReactJS.
Like the "Accordion Component," for example, I've done it multiple times on my other projects, and what I've done differently is make the accordion as reusable as much as possible (I think LOL).
import { Accordion, AccordionItem } from './components/Accordion';
export default const Example = () => {
return (
<Accordion>
<AccordionItem header="What is Bookmark?">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed
do eiusmod tempor incididunt ut labore et dolore magna aliqua.
</AccordionItem>
<AccordionItem header="How can I request a new browser?">
Quisque eget luctus mi, vehicula mollis lorem. Proin fringilla
vel erat quis sodales. Nam ex enim, eleifend venenatis lectus
vitae, accumsan auctor mi.
</AccordionItem>
</Accordion>
)
}
My accordion is heavily inspired from a library React-Accordion
I'm still new to ReactJS, and I'm not sure if I'm doing it correctly. If you have any suggestions or feedback on how I can improve and reduce unnecessary code, please don't hesitate to comment. Thanks.
Community feedback
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord