stephy / CalendarPicker

CalendarPicker Component for React Native
787 stars 369 forks source link

Support for defaultProps #383

Open AjnaSofthouse opened 1 month ago

AjnaSofthouse commented 1 month ago

Warning: Day: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead. in Day

thomas-hs commented 1 month ago

I'm experiencing the same issue is there a way to resolve this?

thomas-hs commented 1 month ago

Hi, are there any updates on this?

haastrupea commented 1 week ago

I am facing this issue as well, a little digging around, I found out that Day.defaultProps way of setting default will soon be removed in React Native in favour of new functionality in both JavaScript and React Native

it is now possible to set default directly like this

function(props = {}){
const {prop1 = [], prop2={}} = props
}

I found that Day.js file on 256 is using the soon-to-be-removed Day.defaultProps

Proposed solution

A PR removing every reference to defaultProps in the project and replacing them with a JavaScript way of setting the default

If this is okay, I can submit PR by the weekend. If anyone can do it way faster, It would be awesome