docs: make legacy.componentApi more visible#11924
Conversation
People didn't know that this exists, so we should make it more visible through having it be part of the error message, and calling it out in the docs with more details
🦋 Changeset detectedLatest commit: 9847e1a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Trying this out locally and realised that it doesn't actually do anything because of the |
| const component = get(source); | ||
|
|
||
| // @ts-expect-error | ||
| check_target(new.target && component); |
There was a problem hiding this comment.
this does the check and then fail even when the compiler option is set, which shouldn't happen in that case
There was a problem hiding this comment.
ah whoops, good catch. fixed. though it now fails with props is undefined, looking into that now
There was a problem hiding this comment.
kinda stumped by this tbh, any ideas?
There was a problem hiding this comment.
seems that checking for the truthiness of new.target (rather than doing an equality check) makes it work. i don't fully understand why the equality check was failing but i'll take it

People didn't know that this exists, so we should make it more visible through having it be part of the error message, and calling it out in the docs with more details