Typescript error with default value for prop #15174
Answered
by
7nik
karchung0930
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
7nik
Feb 1, 2025
Replies: 1 comment 3 replies
-
That's correct: |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
karchung0930
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's correct:
""
won't be replaced by the default value, and"".at(0)
isundefined
. And furthermore, TS doesn't care about the text length in the first place.