compulim / react-scroll-to-bottom

React container that will auto scroll to bottom
MIT License
183 stars 35 forks source link

Remove defaultProps (use default parameters) #141

Open koteus opened 1 month ago

koteus commented 1 month ago

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.

koteus commented 1 month ago

This is a rebased version of my previous PR https://github.com/compulim/react-scroll-to-bottom/pull/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 (https://github.com/compulim/react-scroll-to-bottom/pull/137) I had trouble syncing my changes. Sorry for this compulim, and I hope this one will be moved forward and merged soon 🙏

shgotlib commented 1 month ago

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

rafalzawadzki commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 3 weeks ago

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

josheverett commented 2 weeks ago

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 commented 2 weeks ago

I need this :)

zuhaib10 commented 2 weeks ago

i also need this : )

lx-0 commented 1 week ago

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