From d901535906dfddc33ca188311fa0c88e4528aba4 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Tue, 3 Mar 2020 21:54:20 +0200 Subject: [PATCH] Update Carousel.md Resolves #90 --- snippets/Carousel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/Carousel.md b/snippets/Carousel.md index f1859eb43..4b220b614 100644 --- a/snippets/Carousel.md +++ b/snippets/Carousel.md @@ -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.