fix: annotation details tooltip throwing with hooks#1949
Merged
nickofthyme merged 3 commits intoelastic:mainfrom Jan 27, 2023
Merged
fix: annotation details tooltip throwing with hooks#1949nickofthyme merged 3 commits intoelastic:mainfrom
nickofthyme merged 3 commits intoelastic:mainfrom
Conversation
nickofthyme
pushed a commit
that referenced
this pull request
Jan 27, 2023
# [52.0.0](v51.3.0...v52.0.0) (2023-01-27) ### Bug Fixes * annotation details tooltip throwing with hooks ([#1949](#1949)) ([779b7f3](779b7f3)) * **deps:** update dependency @elastic/eui to v72 ([#1914](#1914)) ([8814c80](8814c80)) * **deps:** update dependency @elastic/eui to v73 ([#1941](#1941)) ([4eeafa7](4eeafa7)) ### BREAKING CHANGES * The `customTooltipDetails` type is now passing `details` as `props` using a `ComponentType`.
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
This fixes a bug that throws an error when react hooks are used inside of a
customTooltipDetailscomponent, under rare circumstances.BREAKING CHANGE: The
customTooltipDetailstype is now passingdetailsas props using aComponentType.Before
Throws error entering the
LineAnnotationmarker icon directly from aRectAnnotation, not from the outside.After
Details
We were treating the
customTooltipDetailsoption as a simpleJSX.Elementthat somehow did not fully register the hooks inside when called as a function in JSX rather than a react component. The solution is to treatcustomTooltipDetailsas aComponentTypeinstead.Issues
Kibana issue elastic/kibana#149414
Checklist
:xy,:partition):interactions,:axis)closes #123,fixes #123)packages/charts/src/index.ts