Mitosis refs do not work when you compile to Vue
See original GitHub issueI tried to run your “Methods and Refs” example code on playground the link and compiled it to Vue. The problem is that refs in Vue don’t have ".current"
😃 but if I change to be just inputRef.focus();
it works the link.
I first discovered that when I was using cli, but I see the same issue on the playground 😃
you can also see it here https://youtu.be/mitz2leHqoE?t=4284 at about 1:11:24
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Template Refs in v-for not working · Issue #5525 · vuejs/core
Open the DevTools and look at the console.logs from onMounted . You now see three logs, each representing a different template Ref. Log...
Read more >Why does the vue documentation say refs are not reactive ...
When data is reactive, it means that changes to the value of that data will trigger a "reaction" from some part of the...
Read more >[SOLVED] This.$refs.key returns undefined when it really is
According to what you said. We cannot get $refs in created is because render function is not yet compiled. And refer to the...
Read more >Vue 3 Composition API: How to Omit `.value` in refs
In this article, we discuss how to omit .value in VueJS refs, creating APIs by converting them into reactive variables using macros.
Read more >How Mitosis compiles components to any framework - YouTube
Write components once, run everywhere. Mitosis can compile to Vue, React, Solid, Angular, Svelte, Qwik, React Native, and moreLearn how it ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If that’s the case, we should consider adding an eslint rule for it.
I think I need to use refs for Web Animation API, since the plain HTML usage is via element method?
https://developer.mozilla.org/en-US/docs/Web/API/Element/animate#examples