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

Remove defaultProps (use default parameters) #141

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

koteus
Copy link

@koteus koteus commented Jul 16, 2024

This fixes React warnings: "Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead."

Changelog

Please copy and paste new entries from CHANGELOG.md here.

Specific changes

Please list each individual specific change in this pull request.

This fixes React warnings: "Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead."
@koteus
Copy link
Author

koteus commented Jul 16, 2024

This is a rebased version of my previous PR #134 I had to open a new one because I opened it from the main branch on my fork (my bad), and because another PR was merged (#137) I had trouble syncing my changes. Sorry for this compulim, and I hope this one will be moved forward and merged soon 🙏

@shgotlib
Copy link

Is there any progress about merging this one? I really need it

@rafalzawadzki
Copy link

Is there any progress about merging this one? I really need it

If you really need it, you can use the branch as dependency, eg.

"react-scroll-to-bottom": "github:koteus/react-scroll-to-bottom#fix/remove-default-props",

in your package.json

@shgotlib
Copy link

shgotlib commented Jul 25, 2024

I tried to install the branch but then got the following error:

[vite] Internal server error: Failed to resolve entry for package "react-scroll-to-bottom". The package may have incorrect main/module/exports specified in its package.json

Do you know why?

@rafalzawadzki
Copy link

I tried to install the branch but then got the following error:

[vite] Internal server error: Failed to resolve entry for package "react-scroll-to-bottom". The package may have incorrect main/module/exports specified in its package.json

Do you know why?

hmm no, unfortunately I don't know why :/ gave a generic advice that works in most cases but seems the fork (or the library itself) may not work well with this workaround

@codeXLinkX
Copy link

@compulim is there anything we can help to get this reviewed and merged?

@josheverett
Copy link

If it's helpful to anyone out there, for a project I work on I finally got annoyed enough to just use patch-package to fix this.

Patch file: react-scroll-to-bottom+4.2.0.patch

Apologies for the size of it -- when my editor auto-formatted the files I was like ehhh whatevs.

@donghoon-song
Copy link

I need this :)

@zuhaib10
Copy link

i also need this : )

@lx-0
Copy link

lx-0 commented Sep 2, 2024

I made a smaller version of @josheverett patch.

react-scroll-to-bottom+4.2.0.patch

  1. Install patch-package: npm i patch-package --save-dev
  2. copy react-scroll-to-bottom+4.2.0.patch to new root folder patches
  3. add "postinstall": "patch-package" to scripts in package.json
  4. run npm ci

@jdmnk
Copy link

jdmnk commented Sep 17, 2024

Bumping this thread, because it would be really useful to merge this :) There is unfortunately no "nice" workaround for getting rid of the error, although there are working solutions in this thread.

@2-fly-4-ai
Copy link

Yes. The Merge. Send it.

@benrugg
Copy link

benrugg commented Oct 25, 2024

Bumping this PR again. I fully get how taxing it is to have a fulltime engineering job and then come home to a pull request. Given the community support on this one, I'd say it's ready to merge and publish! 👍

@willemmulder
Copy link

React 19 is out, and this is now very much needed. @compulim Not sure about your time, but would you be okay to merge it?

manerfan added a commit to ModuBit/modu-web that referenced this pull request Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.