-
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 IsAdmin
component
#299
Conversation
Passing run #756 ↗︎
Details:
Review all test suite changes for PR #299 ↗︎ |
Size Change: 0 B Total Size: 65.7 kB ℹ️ View Unchanged
|
components/is-admin/index.ts
Outdated
* @param {object} props react props | ||
* @param {*} props.fallback fallback component | ||
* @param {*} props.children child components | ||
* @returns {*} | ||
* @param {React.ReactNode|null} props.fallback fallback component | ||
* @param {React.ReactNode} props.children child components | ||
* @returns {null|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.
When we are adding types I think we can safely remove the JSDoc comments.
If we want to add additional context to the type we can add a comment above the type value like so:
interface IsAdminProps {
/**
* fallback component
*/
fallback: React.ReactNode | null;
/**
* child component
*/
children: React.ReactNode;
}
IsAdmin
componentIsAdmin
component
components/is-admin/index.ts
Outdated
export const IsAdmin: React.FC<IsAdminProps> = ({ | ||
fallback = null, | ||
children, | ||
}): null | 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 still think we can leave the return type off here
0087886
to
d69a242
Compare
d69a242
to
d84d2a1
Compare
Description of the Change
Closes #
How to test the Change
Changelog Entry
Credits
Props @fabiankaegy @Sidsector9
Checklist: