-
Notifications
You must be signed in to change notification settings - Fork 357
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
Internal: use multiline comments to enable flow docs #2383
Internal: use multiline comments to enable flow docs #2383
Conversation
✅ Deploy Preview for gestalt ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@@ -18,11 +18,19 @@ const buildSourceLinkUrl = (componentName) => | |||
|
|||
type Props = {| | |||
badge?: 'pilot' | 'deprecated', | |||
// DEPRECATED: Use `children` instead of `defaultCode` | |||
/** | |||
* @deprecated : Use `children` instead of `defaultCode` |
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.
Since flow out of the box doesn't yet support deprecated types, we use JSDoc comments instead:
- Feature request - marking types as deprecated. facebook/flow#4646
- https://jsdoc.app/tags-deprecated.html
Note that in TypeScript, the JSDoc format is also recommended: microsoft/TypeScript#390
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.
Neat! 😍
@@ -18,11 +18,19 @@ const buildSourceLinkUrl = (componentName) => | |||
|
|||
type Props = {| | |||
badge?: 'pilot' | 'deprecated', | |||
// DEPRECATED: Use `children` instead of `defaultCode` | |||
/** | |||
* @deprecated : Use `children` instead of `defaultCode` |
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.
Neat! 😍
Summary
What changed?
Use multiline comments to enable flow docs
Why?
Makes the comments visible to where the props are being used, not just where they are defined.