-
Notifications
You must be signed in to change notification settings - Fork 69
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
[PAR-473] Pass through components from react-responsive and remove custom Responsive components #942
Conversation
- ExtraExtraLarge | ||
- LargerThanExtraSmall | ||
|
||
We will pass through the following components from react-responsive: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: useMediaQuery
and ResponsiveContext
aren't really components, as they are a hook and context respectively. Maybe this line instead says, "...the following components and functionality from react-responsive:"?
@@ -0,0 +1,49 @@ | |||
14. Removal of Custom Responsive Components |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 Thanks for the ADR!
src/Responsive/index.jsx
Outdated
@@ -1,9 +1,12 @@ | |||
import React from 'react'; | |||
import Responsive from 'react-responsive'; | |||
export { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than having these exported from Responsive/index.jsx
, I might lean towards having src/index.js
be responsible for the exports from react-responsive
.
That would leave just the breakpoints
in this file, at which point these could probably be moved to its own standalone file src/utils/breakpoints.js
.
The Paragon components that make use of react-responsive could then still get their responsive imports directly from react-responsive
itself, which is likely a bit more clear and understandable.
Curious to get to get your take, of course! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that structure makes a lot more sense - thanks!
4bf171c
to
0e1a1dc
Compare
and remove custom Responsive components BREAKING CHANGE: Custom Responsive components have been removed in favor of passing through components and functionality from react-responsive directly. Components that have been removed: - `ExtraSmall` - `Small` - `Medium` - `Large` - `ExtraLarge` - `ExtraExtraLarge` - `LargerThanExtraSmall` New passthroughs: - `MediaQuery` - `useMediaQuery` - `ResponsiveContext` Please refer to [react-responsive](https://www.npmjs.com/package/react-responsive) documentation for more information.
0e1a1dc
to
ffc39a4
Compare
🎉 This PR is included in version 17.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
BREAKING CHANGE
This removes custom Responsive components in favor of passing through components from react-responsive directly.
Components that have been removed:
ExtraSmall
Small
Medium
Large
ExtraLarge
ExtraExtraLarge
LargerThanExtraSmall
New passthrough components/hooks:
MediaQuery
useMediaQuery
ResponsiveContext
Supporting information