xgfe / react-native-datepicker

react native datePicker component for both Android and IOS, useing DatePikcerAndroid, TimePickerAndroid and DatePickerIOS
MIT License
2.12k stars 726 forks source link

Warning: componentWillReceivedProps has been renamed and is not recommended for use #418

Open iamraju opened 4 years ago

iamraju commented 4 years ago

Issue

componentWillReceivedProps has been renamed and is not recommended for use

Expected Behavior

It should work without any warnings ?

Code

<DatePicker
              style={{width: 200}}
              date={this.state.date}
              mode="date"
              placeholder="Select Date"
              format="YYYY-MM-DD"
              confirmBtnText="Confirm"
              cancelBtnText="Cancel"
              customStyles={{
                dateIcon: {
                  position: 'absolute',
                  left: 0,
                  top: 4,
                  marginLeft: 0
                },
                dateInput: {
                  marginLeft: 36
                }
                // ... You can check the source to find the other keys.
              }}
              onDateChange={(date) => {this.setState({date: date})}}
            />

Also I got another warning that it has been merged to DatePickerIOS and will be removed in the future. Does that mean we cannot use it for Android anymore ?

asibrahim1985 commented 4 years ago

datepicker.zip Try the attached file I created pull request to merge with master

VovaChampion commented 4 years ago

@asibrahim1985 Thanks. But another warning still presents. "Warning: DatePickerIOS has been merged with DatePickerAndroid and will be removed in a future release. It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. See https://github.com/react-native-community/react-native-datetimepicker"

s4sebin commented 4 years ago

why this plugin is not updating?

dobradovic commented 3 years ago

Any help with this warning?