While grokking our forwardRef API, I found myself wanting some implementation examples which could not be found in the documentation comment.
I also noticed that consumers had no way to define a displayName for the wrapper HOC created by forwardRef.
These changes address both issues by adding extensive examples in the documentation comment for forwardRef that mirror the analogous ReactJS forwardRef documentation, and by adding a displayName argument to the function which then gets set on the JS side via a call to defineProperty.
While grokking our
forwardRef
API, I found myself wanting some implementation examples which could not be found in the documentation comment.I also noticed that consumers had no way to define a
displayName
for the wrapper HOC created byforwardRef
.These changes address both issues by adding extensive examples in the documentation comment for
forwardRef
that mirror the analogous ReactJS forwardRef documentation, and by adding adisplayName
argument to the function which then gets set on the JS side via a call todefineProperty
.FYA: @greglittlefield-wf @joebingham-wk @sydneyjodon-wk