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
feat: add types to RadioTile
#15984
feat: add types to RadioTile
#15984
Conversation
Changes: - Convert `RadioTile` to Typescript and add types. - Add export for new interface `RadioTileProps`. - Normalize PropType descriptions with similar components.
DCO Assistant Lite bot All contributors have signed the DCO. |
@@ -99,27 +164,27 @@ const RadioTile = React.forwardRef(function RadioTile( | |||
|
|||
RadioTile.propTypes = { |
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 took the liberty of updated these prop descriptions to better match the writing style of other components (e.g., TileGroup
, Select
, etc..). If you feel this is out of scope for this PR, I don't mind reverting these changes.
|
||
export default RadioTile; | ||
export { RadioTile }; | ||
|
||
export type { RadioTileProps }; |
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 noticed that many of the recently added types don't export their interface. I'm not sure if there is a good reason not to, but I decided to include it.
This matches the original implementation from DefinitelyTyped and the current export for Checkbox
I have read the DCO document and I hereby sign the DCO. |
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.
Looks good, thank you! 🙏 I think re-running the all contributors script should fix the conflicts.
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
@tw15egan I'm going to push up one more commit to fix the description for |
@cuppajoey No thats fine, I just updated the |
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.
LGTM 👍 ✅
9d445e1
* feat: add types to `RadioTile` Changes: - Convert `RadioTile` to Typescript and add types. - Add export for new interface `RadioTileProps`. - Normalize PropType descriptions with similar components. * docs: fix typos in `propTypes.light` description --------- Co-authored-by: TJ Egan <tw15egan@gmail.com>
Closes #13572
This PR supersedes #14901 and addresses the type errors found in review.
Converts
RadioTile
to Typescript. Add/exports newly added types.Changelog
New
RadioTile.js
→RadioTile.tsx
andRadioTile/index.js
toRadioTile/index.ts
.RadioTileProps
.Changed
TileGroup
,RadioButton
,Select
, etc..).For example, most other PropType descriptions begin with "Provide an optional..." or "Specify whether 'X' should be disabled".
Testing / Reviewing
PropTypes
.PropType
descriptions match the common format of similar components.