Reputation: 1
So I am trying to implement a slideshow of images and on the sliding effect from each image to the other, there will also be changes to the text on the left side. So I am trying to find ways of achieving this whether to make the slideshow as a separate component and the text to be a separate component, and to share the state as a active className such that it is shared between them or apply any other possible strategy. Hope to get help tregarding this.
Upvotes: 0
Views: 770
Reputation: 2627
I would prefer to use two separate components but with their contents depending on two different state variables/objects and using the setState call back to update one state variable after the other. It could be great to have these variables at the parent's react component so it could be possible to pass the parent's reference to its descendants and manipulate those state variables avoiding fights with props. Also, there is a slideshow react component you might like to use at:
https://github.com/femioladeji/react-slideshow
Upvotes: 0