Skip to content

Can someone please explain how the initializeComponentRef utility works? #19438

Answered by swvickers
swvickers asked this question in Q&A
Discussion options

You must be logged in to vote

Ah, my confusion came from not being aware of the handling of "this" as a fake argument parameter which is solely used for type hinting. Described here https://www.typescriptlang.org/docs/handbook/2/functions.html#declaring-this-in-a-function.

The "this" argument is removed from the transpiled output which means the "prevProps" argument is the actual first argument, as expected.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by swvickers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant