1. 27
    Accesse Leaflet Map Instance Inside a React useEffect Hook
    16s

Accesse Leaflet Map Instance Inside a React useEffect Hook

Share this video with your friends

Send Tweet

Once we have a ref set up, we gain the ability to access that ref within React's useEffect hook.

With this, we'll access the current value at the time the useEffect hook is ran.

You can test this out by using the console.log feature and verifying that when logging inside of useEffect, you'll see that your ref has a property of current with a value.

Click here for exercise instructions