How to change the content based on the SegmentButton click

Same question as Question [How to change the content based on the segment-button click]
but for Ionic React.