Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charts - replace getResizeObserver #8533

Merged
merged 2 commits into from Jan 18, 2023
Merged

Conversation

dlabrecq
Copy link
Member

@dlabrecq dlabrecq commented Jan 11, 2023

Removed the getResizeObserver function from react-charts in favor of react-core's getResizeObserver. This helper function now has a third parameter, useRequestAnimationFrame, and allows a single function to be maintained going forward.

pf-codemods README: patternfly/pf-codemods#206

Closes #8531

@patternfly-build
Copy link
Contributor

patternfly-build commented Jan 11, 2023

@dlabrecq dlabrecq changed the title Charts - Replace getResizeObserver Charts - replace getResizeObserver Jan 12, 2023
Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to confirm:

For the v5 branch, PF's getResizeObserver doesn't default to true, which is what should be passed in when the handleResize param isn't debounced and should be passed as a callback to requestAnimationFrame. Did you want to update any of the examples to pass in true to that third param?

@dlabrecq
Copy link
Member Author

dlabrecq commented Jan 13, 2023

@thatblindgeye Using requestAnimationFrame isn't necessary in most cases, so I believe the default should be fine -- the examples appear to work correctly.

We had used requestAnimationFrame with Cost Management to quiet a warning, but probably won't use it going forward. The param is there just in case.

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! Just wanted to make sure in case.

@dlabrecq dlabrecq merged commit 07e3c60 into patternfly:v5 Jan 18, 2023
@patternfly-build
Copy link
Contributor

Your changes have been released in:

  • @patternfly/react-charts@7.0.0-alpha.2
  • @patternfly/react-docs@6.0.0-alpha.4

Thanks for your contribution! 🎉

@dlabrecq dlabrecq deleted the v5-resizeObserver branch January 25, 2023 23:32
jenny-s51 pushed a commit to jenny-s51/patternfly-react that referenced this pull request Jan 27, 2023
* chore(charts): fix typo

* feat(charts): replace getResizeObserver with same function from react-core

fixes patternfly#8531
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants