Setup return vue 3

Hello everyone How do I return render function and ref to setup ?

setup(){
    const showModalState  = ref(false) // must be added to root data
    /*......*/
    
   return () => h('div')

I’m not aware of any way to do this. I think the idea is that if you’re returning an inline render function then nothing needs to be exposed via the instance. showModalState should only be used by other things inside setup.

If you really need to expose showModalState, could you not move the render function outside of setup to a separate render option?