Is there a way to access the DOM on Fresh? #2737
-
Is there a way to access the DOM on fresh? When it comes to Deno itself, there are solutions like deno-dom but seeing the example, I don't understand how to make it work with Fresh. Are there better ways to do that? Should I do it at all? |
Beta Was this translation helpful? Give feedback.
Answered by
rschristian
Oct 28, 2024
Replies: 1 comment 9 replies
-
If you mean server-side (e.g parsing html) you can use |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't have much to do with VDOM or JSX, just how components are built in (p)react.
Depends a bit on whether your click target is a component or not, but here's a super simple example of a toggle button component matching that doc:
You can use bog-standard DOM queries in components, but it's important to know that islands, when server-side rendered, don't have access to the DOM.
document
w…