Skip to content

Commit

Permalink
fix: replace defaultProps with default parameters in SpreadsheetImport
Browse files Browse the repository at this point in the history
React has deprecated the use of `defaultProps` on function components and will remove support in a future major release. This commit replaces the usage of `defaultProps` in the `SpreadsheetImport` component with default parameters to fix the following warning:
  • Loading branch information
gazjones00 committed Oct 2, 2024
1 parent 098d43d commit 3eeabbb
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ export const defaultSpreadsheetImportProps: Partial<
export const SpreadsheetImport = <T extends string>(
props: SpreadsheetImportProps<T>,
) => {
const mergedProps = {
...defaultSpreadsheetImportProps,
...props,
} as SpreadsheetImportProps<T>;

return (
<ReactSpreadsheetImportContextProvider values={props}>
<ModalWrapper isOpen={props.isOpen} onClose={props.onClose}>
<ReactSpreadsheetImportContextProvider values={mergedProps}>
<ModalWrapper isOpen={mergedProps.isOpen} onClose={mergedProps.onClose}>
<SpreadsheetImportStepperContainer />
</ModalWrapper>
</ReactSpreadsheetImportContextProvider>
);
};

SpreadsheetImport.defaultProps = defaultSpreadsheetImportProps;

0 comments on commit 3eeabbb

Please sign in to comment.