title: Vue 3 refs is undefined in render function
body: <p>I have a simple Vue component with root element as <code>ref=&quot;divRef&quot;</code>. However, in <code>onMounted</code> function, <code>divRef.value</code> returns undefined. Any help will be appreciated.</p>
  <pre><code>import { defineComponent, onMounted, ref, Ref, h } from &quot;vue&quot;
  
  export default defineComponent({
      setup(props, context) {
          const divRef = ref() as Ref&lt;HTMLElement&gt;
  
          onMounted(() =&gt; {
              console.log(divRef.value) // undefined
          })
  
          return () =&gt; {
              return h(
                  &quot;div&quot;,
                  {
                      ref: &quot;divRef&quot;
                  },
                  &quot;This is a div&quot;
              )
          }
      }
  })
  
  </code></pre>