I am trying to use the intersection observer to lazy load components. The parent component is conditional and doesn't render immediately until a keyword is searched. The intersection observer should be triggered when the rendered component touches the loading div. What I noticed is that the intersection observer doesn't work immediately.
This is the useEffect that was used in initializing the intersection observer
I am new to react and would love a good explanation wether I am making a mistake with the variables of the "componentdidUpdate" or it's something else. Thank you