datetimepicker icon indicating copy to clipboard operation
datetimepicker copied to clipboard

View config getter callback for component `RNDateTimePicker` must be a function (received `undefined`)

Open AFDHAL2009 opened this issue 1 year ago • 2 comments

👋 Hi! I tried to use this picker in snack for test https://snack.expo.dev/ ,android working fine but ios it show this errors, can some help us to solve this issue and thanks View config getter callback for component RNDateTimePicker must be a function (received undefined)

this simple test code for reproduce

import DateTimePicker from '@react-native-community/datetimepicker';
const App = () => {
  const [date, setDate] = useState(new Date(1598051730000));
return (
<View style={{flex:1}}>
<DateTimePicker
          testID="dateTimePicker"
          value={date}
          mode={'date'}
          is24Hour={true}
          onChange={() => alert('changed')}
        />
</View> 
}
export default App;

image

AFDHAL2009 avatar Mar 06 '24 08:03 AFDHAL2009

Hi, I have also encountered the same problem. My solution was to update the @react-native-community/datetimepicker dependency in package.json to the latest version, 7.6.3, and then the error disappeared. Although Snack indicates that it is not the recommended version for SDK 50.0.0, it does not affect the normal operation of the program. { "dependencies": { "@react-native-community/datetimepicker": "7.6.3", } } Hope it can help

CodingEloise avatar Mar 19 '24 00:03 CodingEloise