react-scroll-to-bottom icon indicating copy to clipboard operation
react-scroll-to-bottom copied to clipboard

Remove defaultProps (use default parameters)

Open koteus opened this issue 1 year ago • 8 comments

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

koteus avatar Nov 06 '23 18:11 koteus

@compulim any chance you could review this?

ImLunaHey avatar Mar 08 '24 21:03 ImLunaHey

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.

compulim avatar Mar 09 '24 01:03 compulim

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: https://github.com/compulim/react-scroll-to-bottom/blob/2d082ec12cecf9890ea14e93915eb7514e6249c9/packages/component/src/BasicScrollToBottom.js#L39

koteus avatar Mar 12 '24 16:03 koteus

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

koteus avatar Apr 05 '24 11:04 koteus

thanks for working on this @koteus 🤝

codeXLinkX avatar Apr 29 '24 19:04 codeXLinkX

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.

ImLunaHey avatar May 08 '24 00:05 ImLunaHey

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.

koteus avatar Jun 05 '24 16:06 koteus

Really hope this can be merged before React 19 release.

wong2 avatar Jun 12 '24 08:06 wong2

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 https://github.com/compulim/react-scroll-to-bottom/pull/141

koteus avatar Jul 16 '24 11:07 koteus