[EuiDualRange] Add regression test for Kibana use of ref
prop
#6467
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.
Summary
Whether we like it or not, there are currently 2 instances of Kibana using the
ref
prop onEuiDualRange
to call the classonResize
method: elastic/kibana@5c575f9. I discovered this because the typing forEuiDualRange
's ref prop became extremely annoying once we started wrapping inwithEuiTheme
.The ideal solution, converting
EuiDualRange
from a class component to a function component, unfortunately also takes away Kibana's ability to callonResize
. This means if/when we do convertEuiDualRange
to a function component, we'll need to deliberately exposeonResize
via React'suseImperativeHandle
API.To ensure we don't forget this, I've added a unit test for calling
rangeRef.current.onResize()
that will fail if we perform the conversion without adding the ref method.QA
General checklist
N/A, dev/test only