A simple application that showcases how Intersection Observer API can be used in React with createRef(). Use case: observe sections in an article and track the current viewed section in a navigation. Read more about it.
- intersection observer API
- React's ref API with createRef() to reference DOM nodes
- intersection observer API polyfill for browsers/testing
git clone git@github.com:the-road-to-learn-react/react-intersection-observer-api-example.git
- cd react-intersection-observer-api-example
- npm install
- npm start
- visit
http://localhost:3000