🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup

Adding a ref to the body tag using Helmet in React

2 replies
Last updated: Jul 2, 2020
is it possible to add a
? I have added classes using
but can't seem to figure out if i can add
this way too
Jul 2, 2020, 4:15 PM
Since there’s a stable global accessor for it (
) you probably don’t need a ref.
Jul 2, 2020, 5:41 PM
yeah, i figured that out after posing the question.
my original problem was i was trying to get to it via a class name rather than it directly
Jul 2, 2020, 5:49 PM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?