Update Carousel.md

Resolves #90
This commit is contained in:
Angelos Chalaris
2020-03-03 21:54:20 +02:00
committed by GitHub
parent 424bf15aa6
commit d901535906

View File

@ -5,7 +5,7 @@ tags: visual,children,state,effect,intermediate
Renders a carousel component.
- Use the `React.setState()` hook to create the `active` state variable and give it a value of `0` (index of the first item).
- Use the `React.useState()` hook to create the `active` state variable and give it a value of `0` (index of the first item).
- Use an object, `style`, to hold the styles for the individual components.
- Use the `React.useEffect()` hook to update the value of `active` to the index of the next item, using `setTimeout`.
- Destructure `props`, compute if visibility style should be set to `visible` or not for each carousel item while mapping over and applying the combined style to the carousel item component accordingly.