Skip to content

travisjupp/react.dev-refCallbackCarousel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react.dev-refCallbackCarousel

Created with CodeSandbox

Challenge 3 of 4: Scrolling an image carousel

This image carousel has a “Next” button that switches the active image. Make the gallery scroll horizontally to the active image on click. You will want to call scrollIntoView() on the DOM node of the active image:

Forked from: https://react.dev/learn/manipulating-the-dom-with-refs#scrolling-an-image-carousel

Manage a list of refs with a ref-callback: https://react.dev/learn/manipulating-the-dom-with-refs#how-to-manage-a-list-of-refs-using-a-ref-callback

About

Pass a function to the ref attribute to add refs to a long list of elements in React

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published