Interface with the React Leaflet Map API with the useRef and useEffect React Hooks
lessonDuration 1m 57sFree
In this lesson, you will learn how to use React hooks to interface with the Leaflet Map API in React Leaflet. We'll connect a ref to our Map component using the useRef hook and then use the useEffect hook to access that ref, find our Map instance, and use it to fly to a new location. [More details on the Leaflet Map API](https://leafletjs.com/reference-1.6.0.html#map)