DavidHDev/vue-bits

[FEAT]: Migrate template refs to use 'useTemplateRef'

Closed this issue · 2 comments

Share your suggestion

Hey! 😄

I'd like to propose to migrate the existing template references from the legacy 'ref<HTMLElement | null>(null)' pattern to Vue 3.5 'useTemplateRef' API.

This approach represents the framework's official direction for template references management and it has a couple of benefits like:

  • Enhanced type safety by eliminating nullable type annotations, since Vue will handle the initalization
  • Provides explicit naming conventions
  • Reduces boilerplate code and potential null reference errors

You can find more info down below:

useTemplateRef()

Validations

  • I have checked other issues to see if my issue was already discussed or addressed

Sounds good!

Appreciate it! #39