this.refs is empty
See original GitHub issueI get this.refs
as Object {}
and unable to open()
/close()
drawer
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:12 (5 by maintainers)
Top Results From Across the Web
this.$refs always empty or undefined in Vue component
$refs either always comes back undefined or as an empty object, and I don't know what I'm doing wrong. In a parent component,...
Read more >[Solved] This.$refs return empty object - Get Help - Vue Forum
I want to get my element like javascript's document.getElementById('elementId'), but it doesn't work. I've done a search and it's say i ...
Read more >$refs empty in mounted callback when another component is ...
Make another Vue component a parent of your current component and $refs will be undefined. Worked as it should in 2.14 with @nuxt/components...
Read more >A complete guide to React refs - LogRocket Blog
Learn how to use React refs, and why it's important to use them ... Instead, we use useRef(null) to create refs in functional...
Read more >[Solved]-Vue.js this.$refs empty due to v-if-Vue.js
... during mounting it cannot work since the $refs.autocomplete is not existing yet but I'm not sure you need it since your v-model...
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 Free
Top 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
If your drawer is in a navigator your need to access it through the navigator’s refs
And make sure you set the ref on the Navigator as well
You could also use the call back syntax for setting refs: https://facebook.github.io/react/docs/more-about-refs.html#the-ref-callback-attribute
did you set
ref="drawer"
on your drawer component?Alternatively you can try using the drawer via context