[EuiDualRange] Add regression test for Kibana use of ref prop#6467
Merged
cee-chen merged 1 commit intoelastic:mainfrom Dec 7, 2022
Merged
[EuiDualRange] Add regression test for Kibana use of ref prop#6467cee-chen merged 1 commit intoelastic:mainfrom
ref prop#6467cee-chen merged 1 commit intoelastic:mainfrom
Conversation
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_6467/ |
1Copenut
approved these changes
Dec 7, 2022
Contributor
1Copenut
left a comment
There was a problem hiding this comment.
👍 LGTM! Your comments and logic make this very easy to follow as a defensive test for future breaking changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
refprop onEuiDualRangeto call the classonResizemethod: 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
EuiDualRangefrom a class component to a function component, unfortunately also takes away Kibana's ability to callonResize. This means if/when we do convertEuiDualRangeto a function component, we'll need to deliberately exposeonResizevia React'suseImperativeHandleAPI.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