Skip to content

Remove defaultProps (use default parameters) #134

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

Closed
wants to merge 0 commits into from

Conversation

koteus
Copy link

@koteus koteus commented Nov 6, 2023

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

@ImLunaHey
Copy link

@compulim any chance you could review this?

@compulim
Copy link
Owner

compulim commented Mar 9, 2024

Sorry, my real world job is very busy recently. I will take a look at this as soon as I am freed up. 🙇🏻‍♂️

This is a very good move, getting rid of defaultProps.

I think @koteus spent some time thinking BasicScrollToBottomCore.initialScrollBehavior. This is the part I need to some reading time. Will be great if someone could speed me up on this.

@koteus
Copy link
Author

koteus commented Mar 12, 2024

Hi @compulim I think you mean the default value "smooth" for initialScrollBehavior, I provided it by using javascript default value for object destructuring syntax (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#default_value)

Here is the line:

Copy link

@ImLunaHey ImLunaHey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@koteus
Copy link
Author

koteus commented Apr 5, 2024

Hi @compulim is there anything I could do to help you review this PR?

@codeXLinkX
Copy link

thanks for working on this @koteus 🤝

@ImLunaHey
Copy link

hate to be that person but is there anything holding this back?

@compulim the code looks fine, if you can approve the CI this can be merged and a new release can be cut.

@koteus
Copy link
Author

koteus commented Jun 5, 2024

Hello 👋
Support for defaultProps in function components has been officially removed in React 19

https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-proptypes-and-defaultprops

Merging this PR will allow react-scroll-to-bottom to support React 19 (unless there are any other deprecated features). Right now React 19 is RC and stable release will probably be announced soon.

@wong2
Copy link

wong2 commented Jun 12, 2024

Really hope this can be merged before React 19 release.

@koteus
Copy link
Author

koteus commented Jul 16, 2024

I rebased my PR on the latest main and I had to create a new PR because my this one was initiated from the main branch. During rebase I pressed "sync" and Github closed this PR, so please check out the new one #141

@2-fly-4-ai
Copy link

This is still an issue.

@dimeloper
Copy link

any updates here?

@josheverett
Copy link

@2-fly-4-ai @dimeloper

You can use this patch: #141 (comment)

@koteus
Copy link
Author

koteus commented Apr 2, 2025

Hello, in case you are still looking for a solution, I posted info about my forked version here #141 (comment)

Basically it works with React 19 without warnings, but I rewrote some stuff so there are breaking changes!!

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.

8 participants