FAQ Component in React

Inside <FAQComponent /> it maps through the data to create a <Collapsible /> component for each, and also passes the index of each object. Inside the <Collapsible /> there is a <details> with a <summary> as the question. And the hidden <details> is the answer. Details is open if index is 0.


Requested feedback

Please let me know of any way I can dry this code up and make it any more efficient! Open to any feedback. Thanks :)

Comments

Get future questions delivered straight to your inbox for free

Sign up and receive instant access to new questions when we publish them.

We‘ll only use your information to deliver new questions and to provide you updates about our product. We‘ll never spam you or sell your information without your consent. Unsubscribe at any time.