Issue
What do each of these nulls mean in vue ref?
const submitButton = ref<HTMLButtonElement | null>(null);
Solution
The first null is part of the type (which is defined between angle brackets <>).
Meaning that the value of this ref() can be either a HTMLButton Element, or null.
The second null is the value of the ref that is initially being set.
So submitButton is a ref that can either be a buttonelement or null and it is currently null.
Answered By - WebstraDev
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.