-
Notifications
You must be signed in to change notification settings - Fork 26
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
Update types for former defaultProps to be optional #3044
Conversation
… the type interface so that it is not mandatory to pass them
🦋 Changeset detectedLatest commit: fe9253d The changes in this PR will be included in the next version bump. This PR includes changesets to release 99 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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
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.
Just one question which I assume to lack context on.
@@ -112,7 +112,7 @@ describe('generate README (for TS file)', () => { | |||
|
|||
## Description | |||
|
|||
Render an Justice League | |||
Render a Justice League |
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 makes the PR worthwhile.
@@ -101,7 +101,7 @@ export const handleColumnsUpdate = ( | |||
: selectedColumns; | |||
|
|||
const columns = isSwap ? selectedColumns : availableColumns; | |||
const draggedColumn = columns.find( | |||
const draggedColumn = columns!.find( |
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.
Sorry, but if this is optionally don't we conditionally chain here?
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.
we know that availableColumns
will always be []
because of the default param on line 134 - optional chaining is probably the better choice though
In preparation for upgrading ui kit to react 19, it was necessary to remove all
defaultProps
in favor of passing a default param to the prop.This PR updates the types of any prop that has a default param to be optional so that it is not mandatory to pass the prop in consuming applications. This reduces the amount of refactoring that consumers will have to do to satisfy typechecking.