Skip to content

Struggling with documentation - add different content under different tabs (React) #4936

Closed Answered by elizabetdev
plaformsre asked this question in Q&A
Discussion options

You must be logged in to vote

You can add a onClick to each object of your tabs[] and save into a state what is the current selected tab. Then you can render your content based on your selection.

This is a very basic example (you can create something more dynamic): https://codesandbox.io/s/nifty-meitner-cqd9v?file=/index.js.

Let me know if this answer was helpful.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by cchaos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #4935 on July 05, 2021 14:15.