-
Notifications
You must be signed in to change notification settings - Fork 98
chore: migrate defaultProps
to default assignment
#2008
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
base: main
Are you sure you want to change the base?
chore: migrate defaultProps
to default assignment
#2008
Conversation
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.
@ chris-schneider-zen thanks so much for your patience on this. The update is looking great. I left a few comments. Along with addressing those, if you're able to make a couple of updates, I think we'll be able to get this through fairly quickly:
- resolve conflicts with the current
main
branch - if possible, move this to a direct branch rather than a fork (I sent you an org invite). That will make sure the full CI runs, including deployment. And that will make my turnaround review much easier.
🙇
})<IStyledColProps>` | ||
'data-garden-version': PACKAGE_VERSION, | ||
$columns: props.$columns ?? 12, | ||
theme: props.theme ?? DEFAULT_THEME |
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.
})<IStyledGridProps>` | ||
'data-garden-version': PACKAGE_VERSION, | ||
$gutters: props.$gutters ?? 'md', | ||
theme: props.theme ?? DEFAULT_THEME |
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.
Ditto, this theme
default can be removed
})<IStyledRowProps>` | ||
'data-garden-version': PACKAGE_VERSION, | ||
$wrapAll: props.$wrapAll ?? 'wrap', | ||
theme: props.theme ?? DEFAULT_THEME |
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.
Ditto, this theme
default can be removed
'data-garden-version': PACKAGE_VERSION | ||
})<IStyledTagProps>` | ||
'data-garden-version': PACKAGE_VERSION, | ||
theme: props.theme ?? DEFAULT_THEME, |
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.
Ditto, this theme
default can be removed
<StyledParagraph ref={ref} {...props} /> | ||
)); | ||
export const Paragraph = forwardRef<HTMLParagraphElement, IParagraphProps>( | ||
({ size = 'medium', ...props }, ref) => <StyledParagraph ref={ref} size={size} {...props} /> |
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.
Not imperative for this PR, but it would be good to fix the $size
transient prop naming for the underlying StyledParagraph
component
$isMonospace: true | ||
})<IStyledCodeProps>` | ||
$isMonospace: true, | ||
theme: props.theme || DEFAULT_THEME, |
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.
Ditto, this theme
default can be removed
Description
As of React v19
defaultProps
is fully deprecated. Currently in React v18 it does warn against this being removed, so we can easily migrate these within the codebase.This PR does the work of eliminating and replace
defaultProps
with one of two patterns:a. default parameter values (with destructuring)
b. nullish coalescing within
styled::attrs()
callbacksDetails
Checklist
npm start
)?bedrock
)