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.
What:
Make refs point to the most obvious element in
Input
andPassword
components and correct refs usages in our components. Apart from that I've also removed theforwardRef
from our internalDatepicker
component since it wasn't being used (this is not a component exposed by Wave, it's used internally byDatepickerSingleInput
andDatepickerRangeInput
)
Why:
To correct our usages of refs so that it follows our agreement.
How:
Input
,Password
andInnerInput
toHTMLInputElement
InnerInput
so it's passed to the input instead of to the wrapperDatepickerRangeInput
to use the newInput
refPhoneInput
to use the newInput
refforwardRef
fromDatepicker
Other:
After this PR we are only forwarding refs in 3 places in the codebase:
Input
andPassword
components (external components that our users can use)InnerInput
component (internal component that we don't expose, needed forInput
andPassword
)Since the ref in the
Datepicker
(internal) was not being used in either of it's parents (the actualDatepicker
andDatepickerRangeInput
components that we expose) there was no way for a project to depend on this ref, so I've decided to remove it. Even if in the future we decide to have a ref/refs inDatepicker
it will point to a different element, since the one removed did not follow our agreement on refs.Checklist:
Datepicker
Closes #169