mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-27 19:25:11 +08:00
Native propTypes RCTDatePickerIOS !== propTypes DatePickerIOS
Summary: The propTypes of RCTDatePickerIOS do not fit with the propTypes of DatePickerIOS. All dates (date, minimumDate, maximumDate) are a timestamp (check line 126), so they should have propType number. OnDateChange function should not be required since it is called onChange in the iOS implementation. The problem currently causes warnings that the given types are wrong, while they were added correctly. Closes https://github.com/facebook/react-native/pull/7833 Differential Revision: D3371324 Pulled By: nicklockwood fbshipit-source-id: bca5b2bbe7e9dd2e045288bfbd268578848c7bff
This commit is contained in:
committed by
Facebook Github Bot 6
parent
0cc0aaecbb
commit
cec913e7ce
@@ -145,8 +145,15 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
});
|
||||
|
||||
var RCTDatePickerIOS = requireNativeComponent('RCTDatePicker', DatePickerIOS, {
|
||||
nativeOnly: { onChange: true },
|
||||
const RCTDatePickerIOS = requireNativeComponent('RCTDatePicker', {
|
||||
propTypes: {
|
||||
...DatePickerIOS.propTypes,
|
||||
date: PropTypes.number,
|
||||
minimumDate: PropTypes.number,
|
||||
maximumDate: PropTypes.number,
|
||||
onDateChange: () => null,
|
||||
onChange: PropTypes.func,
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = DatePickerIOS;
|
||||
|
||||
Reference in New Issue
Block a user