-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix: replace defaultProps with default parameters in SpreadsheetImport #7406
Merged
FelixMalfait
merged 1 commit into
twentyhq:main
from
gazjones00:fix/spreadsheet-import-remove-defaultprops
Oct 2, 2024
Merged
fix: replace defaultProps with default parameters in SpreadsheetImport #7406
FelixMalfait
merged 1 commit into
twentyhq:main
from
gazjones00:fix/spreadsheet-import-remove-defaultprops
Oct 2, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:
Log
|
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.
PR Summary
This pull request addresses the deprecation of defaultProps in React function components, specifically in the SpreadsheetImport component.
- Updated
SpreadsheetImport
inpackages/twenty-front/src/modules/spreadsheet-import/provider/components/SpreadsheetImport.tsx
to use object spread syntax for merging default and incoming props - Removed
SpreadsheetImport.defaultProps = defaultSpreadsheetImportProps;
to align with React's future direction - Resolved warning message related to defaultProps deprecation in function components
- Improved code maintainability and future-proofed the component against upcoming React changes
- Addresses issue When user wants to import data, error in devtools appears #6827, eliminating the error in devtools when importing data
1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
FelixMalfait
approved these changes
Oct 2, 2024
Perfect thank you! |
harshit078
pushed a commit
to harshit078/twenty
that referenced
this pull request
Oct 14, 2024
twentyhq#7406) This PR addresses twentyhq#6827 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: **Changes:** - Removed `SpreadsheetImport.defaultProps = defaultSpreadsheetImportProps;` - Merged `defaultSpreadsheetImportProps` with incoming `props` using object spread syntax. - Adjusted the component to use the merged props (`mergedProps`) instead of `props`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses #6827
React has deprecated the use of
defaultProps
on function components and will remove support in a future major release. This commit replaces the usage ofdefaultProps
in theSpreadsheetImport
component with default parameters to fix the following warning:Changes:
SpreadsheetImport.defaultProps = defaultSpreadsheetImportProps;
defaultSpreadsheetImportProps
with incomingprops
using object spread syntax.mergedProps
) instead ofprops
.