-
|
RT |
Beta Was this translation helpful? Give feedback.
Answered by
gbj
Nov 24, 2025
Replies: 1 comment 5 replies
-
|
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Note that
onMountin Solid is also just an effect and does not necessarily run after the component is actually mounted. That's why the example is helpful:leptos_routeris effectively doing something similar to the playground example with conditional rendering above, in which the component is rendered, and elements are created, and effects run -- but the elements are not yet actually connected to the DOM.If you're trying to get access to a particular element (the equivalent of
getElementById) then using aNodeRefis indeed the correct way to do it. (This has the benefit of giving you better types than.get_element_by_id()as well.)