Remove defaultProps (use default parameters)
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.mdhere.
Specific changes
Please list each individual specific change in this pull request.
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 🙏
Is there any progress about merging this one? I really need it
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
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?
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.jsonDo 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
@compulim is there anything we can help to get this reviewed and merged?
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.
I need this :)
i also need this : )
I made a smaller version of @josheverett patch.
react-scroll-to-bottom+4.2.0.patch
- Install patch-package:
npm i patch-package --save-dev - copy
react-scroll-to-bottom+4.2.0.patchto new root folderpatches - add
"postinstall": "patch-package"toscriptsinpackage.json - run
npm ci
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.
Yes. The Merge. Send it.
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! 👍
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?
Hi guys, I forked this repo and re-published the package on npm under my namespace and I bumped version to 5.0 because I need it to work with React 19 🚀 and there are some breaking changes:
In case it will be useful for someone you can import it like this
"@koteus/react-scroll-to-bottom": "5.0.1-main.840fa77",
and here is the link https://www.npmjs.com/package/@koteus/react-scroll-to-bottom
Also, in my version I removed Emotion CSS and use CSS modules instead so nothing is compiling at runtime. You should import style as well, for example:
import ReactScrollToBottom, { StateContext } from '@koteus/react-scroll-to-bottom';
import '@koteus/react-scroll-to-bottom/style.css';
It means I also removed unneeded props: nonce and styleOptions.stylesRoot because styles are not generated on runtime there is no need for these features (so I removed the code related to them also)
Also it includes type definitions which I took from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-scroll-to-bottom/index.d.ts
So there is no need to install @types/react-scroll-to-bottom for typescript projects.
The forked version now uses Vite for much faster building and it does not use Babel any more. I don't know about browser compatibility, so let me know if there are any issues!
Please note that some tests might be broken as I did not have time to take a proper look at them and this is because it now uses bun + vite instead of npm, lerna, babel, webpack, so lots of code is changed, but I kept the logic. The repo is https://github.com/koteus/react-scroll-to-bottom
Enjoy! 😎