DEV Community

Discussion on: Create section navigation with React and Intersection Observer

 
thatfemicode profile image
thatFemicode

Now I am observing with refs.name but still getting that error

Thread Thread
 
maciekgrzybek profile image
Maciek Grzybek

There is no such a thing like refs.name in you code. Console log it and see what you are getting. If you want to access ref with specific name you need to access it with refs[name]. Also, you need to add a observer for each name.

Thread Thread
 
thatfemicode profile image
thatFemicode

Thanks Maceik, i'll look at your approach again once i am free cus right now tbh i am not really getting what i am doing again cus i had to learn a lot two weeks ago