This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat(Ref): support of
forwardRef()
API #491feat(Ref): support of
forwardRef()
API #491Changes from 3 commits
62929d9
9882478
46c6913
17cbc97
33c95c1
57faf87
bb93b77
306ca3b
97594a7
c418eec
747931c
d11dcc4
1501b0d
0d75b11
6f0039f
1c77d7b
31de50a
5642eab
bce1d43
098ee71
a2f7fd1
8e41c02
b8a3384
e1d73e1
921f35a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The usage of generic in docs :( It's impossible to omit it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, and this is definitely not the problem of this PR :) seems that we should use JS engine to process this code, as docs are aimed to present JS variant of examples to the client (this is the case for now, at least)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm planning to left this thing as is and push #495 that will resolve all our issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, very confused by trying to understand how
Ref
component is helpful in case of ref forwarding (and this, as stated in the description, is its main purpose:This PR is redesign of Ref component to use forwardRef API by default and use findDOMNode() only as a fallback.
)Let me explain resaons for this by following the example. Suppose that I am a Stardust client and have the following component:
With this component I already expect the following to be true:
Then comes Stardust and proposes to use
Ref
- with no clear benefits to me, as now it will be either:Ref
as another wrapper - but what are the benefits of that :/ ?Ref
, in case of ref forwarding case, acts as a simpleref
translator - so, what are the reasons I wouldn't use built-in React ref forwarding capabilities and would preferRef
component abstraction instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(!) A new dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to ref's docs: https://reactjs.org/docs/refs-and-the-dom.html
The parameter type used in this function leads to false assumptions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment below, we will enforce user to pass correct refs.