-
Notifications
You must be signed in to change notification settings - Fork 42
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
upkeep: Add TS support for Optional
component
#298
Conversation
Size Change: -122 B (0%) Total Size: 65.6 kB
|
Passing run #768 ↗︎
Details:
Review all test suite changes for PR #298 ↗︎ |
components/optional/index.ts
Outdated
@@ -1,7 +1,15 @@ | |||
import PropTypes from 'prop-types'; |
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 think that as part of converting something to TypeScript it makes sense to get rid of all the PropTypes stuff.
components/optional/index.ts
Outdated
export const Optional: React.FC<OptionalProps> = ({ | ||
value, | ||
children, | ||
}): boolean | React.ReactNode => { |
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'm not sure we need / want to explicitly type the return type of every function. If something can be inferred I would rather just leave it up to the compiler
Optional
componentOptional
component
Optional
componentOptional
component
Co-authored-by: Fabian Kägy <[email protected]>
…ponents into upkeep/component-optional
components/optional/index.ts
Outdated
Optional.defaultProps = { | ||
value: '', | ||
}; |
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.
This can be removed now that we have the default value inline
…ponents into upkeep/component-optional
Description of the Change
Closes #
Changelog Entry
Credits
Props @fabiankaegy @Sidsector9
Checklist: