Hello folks,
I'm somehow new to React. I thrive to write testable code.
I have my Home page which renders either HomePublic or HomePrivate. Depending on whether a user is logged in or not.
Now, it happens that I designed my public home page template with
scrollstop effect (and just that page), which just works by applying .scrollstop
on :root > body > main.
I now wonder how I may properly reference :root > body > main from HomePublic.
I'll rely on useEffect to apply or remove my class.
I think refs are the recommended way of doing this in react.
How to turn my app container element into react ref ?
No responses yet.