Check out example codes for "vue js focus ref". It will help you in understanding the concepts better.

Code Example 1

<input type="text" ref="searchbar">

<script>
export default {
  mounted() {
    this.$refs.searchbar.$el.focus();
  }
};
</script>

Learn ReactJs, React Native from akashmittal.com