-
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): updated props for v11 #9628
chore(Tile): updated props for v11 #9628
Conversation
✔️ Deploy Preview for carbon-react-next ready! 🔨 Explore the source changes: 11a5dc5 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-react-next/deploys/6148b728e767cc0007d4474e 😎 Browse the preview: https://deploy-preview-9628--carbon-react-next.netlify.app |
✔️ Deploy Preview for carbon-components-react ready! 🔨 Explore the source changes: 11a5dc5 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-components-react/deploys/6148b7284548e10007d2eb4f 😎 Browse the preview: https://deploy-preview-9628--carbon-components-react.netlify.app |
✔️ Deploy Preview for carbon-elements ready! 🔨 Explore the source changes: 11a5dc5 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-elements/deploys/6148b728593b4900085bc670 😎 Browse the preview: https://deploy-preview-9628--carbon-elements.netlify.app |
@@ -549,7 +579,8 @@ export class ExpandableTile extends Component { | |||
}, | |||
() => { | |||
this.setMaxHeight(); | |||
this.props.handleClick(evt); | |||
// TODO: Remove handleClick prop when handleClick is deprecated | |||
this.props.handleClick?.(evt) || this.props.onClick(evt); |
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.
Should the same optional chaining exist for onClick
so we only call it if they pass it in? Would prevent the need for the no-op defaultProp functions.
@@ -574,20 +605,20 @@ export class ExpandableTile extends Component { | |||
tileMaxHeight, // eslint-disable-line | |||
tilePadding, // eslint-disable-line | |||
handleClick, // eslint-disable-line | |||
onClick, | |||
onKeyUp, | |||
onClick, // eslint-disable-line |
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.
Probably worth adding a note why its disabled so we can change the rule or fix it in the future
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.
Couple quick questions
@@ -196,10 +196,8 @@ export class ClickableTile extends Component { | |||
href={href} | |||
className={classes} | |||
{...rest} | |||
// TODO: replace with onClick when handleClick prop is deprecated |
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 actually didn't mind these comments, @joshblack do you have a preference for tracking things we'll need to rip out post-v11.
REF #9535
Changelog
Tile
.Tile
by changing{...other}
->{...rest}
andclassNames
->cx
.Tile
story with new props.Testing / Reviewing