reactstrap icon indicating copy to clipboard operation
reactstrap copied to clipboard

chore(fixes #2801): use function default parameters

Open islam-kamel opened this issue 1 year ago • 5 comments
trafficstars

chore(fixes #2801): use function default parameters instead of defaultProps

  • [x] Bug fix
  • [ ] New feature
  • [x] Chore
  • [ ] Breaking change
  • [x] There is an open issue which this change addresses
  • [x] I have read the CONTRIBUTING document.
  • [x] My commits follow the Git Commit Guidelines
  • [x] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
    • [ ] I have updated the documentation accordingly.
  • [ ] My change requires a change to Typescript typings.
    • [ ] I have updated the typings accordingly.
  • [x] I have added tests to cover my changes.
  • [x] All new and existing tests passed.

islam-kamel avatar May 21 '24 04:05 islam-kamel

@illiteratewriter please check these changes.

islam-kamel avatar May 21 '24 04:05 islam-kamel

Please, update all the components that use defaultProps.

kamenminkovcom avatar Jun 25 '24 13:06 kamenminkovcom

LGTM

illiteratewriter avatar Jun 25 '24 14:06 illiteratewriter

What is the reason for not using Javascript default props?

sbaechler avatar Jun 28 '24 12:06 sbaechler

What is the reason for not using Javascript default props?

Ah, because even undefined props are set (by the prop types?) to undefined and would override the default props.

sbaechler avatar Jun 28 '24 13:06 sbaechler

I'm still seeing this issue with v9.2.3 on the Popover component

console.js:288 Warning: Popover: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead. at Popover (http://localhost:3000/static/js/bundle.js:503660:95)

charlesfayal avatar Sep 27 '24 17:09 charlesfayal

I'm still seeing this issue with v9.2.3 on the Popover component

console.js:288 Warning: Popover: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead. at Popover (http://localhost:3000/static/js/bundle.js:503660:95)

same for tooltip and popover component...

SabihYallaMotor avatar Sep 30 '24 11:09 SabihYallaMotor