-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
chore(tile): refactor to functional component #9721
chore(tile): refactor to functional component #9721
Conversation
✔️ Deploy Preview for carbon-react-next ready! 🔨 Explore the source changes: 51b9b78 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-react-next/deploys/6166f0a96aa137000832a6c9 😎 Browse the preview: https://deploy-preview-9721--carbon-react-next.netlify.app |
✔️ Deploy Preview for carbon-components-react ready! 🔨 Explore the source changes: 51b9b78 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-components-react/deploys/6166f0a9fefba7000735cea0 😎 Browse the preview: https://deploy-preview-9721--carbon-components-react.netlify.app |
✔️ Deploy Preview for carbon-elements ready! 🔨 Explore the source changes: 51b9b78 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-elements/deploys/6166f0a9d015b30008b4b1dc 😎 Browse the preview: https://deploy-preview-9721--carbon-elements.netlify.app |
Co-authored-by: Josh Black <josh@josh.black>
Co-authored-by: Josh Black <josh@josh.black>
Co-authored-by: Josh Black <josh@josh.black>
Co-authored-by: Josh Black <josh@josh.black>
Co-authored-by: Josh Black <josh@josh.black>
Co-authored-by: Josh Black <josh@josh.black>
derp |
Tested components and they're working as expected. Just had those notes on the deprecation stuff. |
thx! i'll get those warnings in there next :) |
@@ -34,6 +34,7 @@ | |||
"postinstall": "carbon-telemetry collect --install", | |||
"prepublish": "yarn build", | |||
"start": "yarn storybook", | |||
"start:v11": "CARBON_ENABLE_V11_RELEASE=true yarn storybook", |
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.
NOICEEEE!!! 🔥
REF #9712
Refactored most of the Tile component to make functional components using
React.forwardRef
to ensure refs were being forwarded appropriately.ExpandableTileNotes
getDerivedStateFromProps
fromClickableTile
. Everything seems still be working without it and the guidance from React suggests that you rarely need it.Testing / Reviewing
Pull down the PR locally.
Run
yarn start:v11
frompackages/react
Ensure that the following stories for Tile are all working as expected:
Default
ClickableTile
Multi Select
Radio
Note: I have not refactored
ExpandableTile
in this PR.