Skip to content
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

When user wants to import data, error in devtools appears #6827

Closed
BOHEUS opened this issue Sep 1, 2024 · 6 comments
Closed

When user wants to import data, error in devtools appears #6827

BOHEUS opened this issue Sep 1, 2024 · 6 comments
Labels
good first issue Good for newcomers prio: low scope: front Issues that are affecting the frontend side only size: short type: bug Something isn't working

Comments

@BOHEUS
Copy link
Contributor

BOHEUS commented Sep 1, 2024

Scenario:

  1. Log in
  2. Go to any Object tab (e.g. Companies)
  3. Click on Options > Import

Actual: Error in devtools appears
image

Expected: No error should appear in devtools

Error:

Warning: SpreadsheetImport: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
@BOHEUS BOHEUS added the type: bug Something isn't working label Sep 1, 2024
@Bonapara Bonapara added scope: front Issues that are affecting the frontend side only for experienced contributor labels Sep 3, 2024
@FelixMalfait
Copy link
Member

I think this should be fairly easy to fix (?).
We need to update spreadsheetImport.tsx and get rid of defaultProps.
Not sure what's the impact but it's probably not very hard to replace it (?)

@gazjones00
Copy link
Contributor

I'll pick this up @FelixMalfait

@FelixMalfait
Copy link
Member

Thank you @gazjones00!

FelixMalfait pushed a commit that referenced this issue Oct 2, 2024
#7406)

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 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`.
@gazjones00
Copy link
Contributor

@FelixMalfait can we mark this as closed, please?

@gazjones00 gazjones00 removed their assignment Oct 2, 2024
@FelixMalfait
Copy link
Member

Yes @gazjones00 thank you! Next time you can add "fixes #xxxx" in your PR description to link it and close the issue automatically

@gazjones00
Copy link
Contributor

Yes @gazjones00 thank you! Next time you can add "fixes #xxxx" in your PR description to link it and close the issue automatically

Sounds good, thank you!

harshit078 pushed a commit to harshit078/twenty that referenced this issue 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
Labels
good first issue Good for newcomers prio: low scope: front Issues that are affecting the frontend side only size: short type: bug Something isn't working
Projects
Status: ✅ Done
Development

No branches or pull requests

4 participants