-
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
'@commercetools-uikit/date-time-input': minor | ||
'@commercetools-uikit/data-table-manager': minor | ||
'@commercetools-uikit/loading-spinner': minor | ||
'@commercetools-uikit/data-table': minor | ||
'@commercetools-uikit/pagination': minor | ||
'@commercetools-local/generator-readme': minor | ||
'@commercetools-uikit/design-system': minor | ||
--- | ||
|
||
Update types for props that were formerly defaultProps to be optional so that consuming apps do not need to change how they declare certain components. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ export type TColumnData = { | |
|
||
export type TColumnSettingsManagerProps = { | ||
title?: string; | ||
availableColumns: TColumnData[]; | ||
availableColumns?: TColumnData[]; | ||
selectedColumns: TColumnData[]; | ||
onUpdateColumns: (updatedColums: TColumnData[]) => void; | ||
areHiddenColumnsSearchable?: boolean; | ||
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. we know that |
||
(col) => col.key === dragResult.draggableId | ||
); | ||
|
||
|
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.