Closed Eprince-hub closed 1 year ago
Hi @Eprince-hub, I pulled down your project and you're missing the translation registration. This can be resolved by adding
import {DatePickerModal, en, registerTranslation} from 'react-native-paper-dates';
React.useEffect(() => {
registerTranslation('en', en);
}, []);
to your App.tsx
.
This is also found in the documentation here.
Oh, Thanks a lot, this was my problem.. My Bad!🙏
Hi @Eprince-hub, I pulled down your project and you're missing the translation registration. This can be resolved by adding
import {DatePickerModal, en, registerTranslation} from 'react-native-paper-dates'; React.useEffect(() => { registerTranslation('en', en); }, []);
to your
App.tsx
.This is also found in the documentation here.
Thanks ! :)
@iM-GeeKy it can be better put outside the render function with no useEffect
Current behaviour
The
react-native-paper-dates
throws some errors on a react native project that is created withreact-native-cli
The first error is like the one below, but clicking on dismiss reveals more errors that mostly say the same thing but with different
key:...
valuesExpected behaviour
Clicking on the activating the
DatePickerModal
should not throw any error, especially when the exact code example from the documentation is being usedHow to reproduce?
Hey, i am providing a reproduction to the error here in the repo https://github.com/Eprince-hub/react-native-date-picker-error
Steps to reproduce (Couldn't reproduce the problem on snack.expo.dev)
Clone the repo & cd into project
Install all Dependencies
Start & run both ios & android
Click on
pick single date
and see the error There is a total of ten errors, clicking ondismiss
will reveal next errorPreview
Video
https://github.com/web-ridge/react-native-paper-dates/assets/74430629/6e3de0bd-1f86-47ed-ba7b-baefb280008d
What have you tried so far?
tried debugging the issue with no success, did some online searches and found similar issue being reported here https://github.com/web-ridge/react-native-paper-dates/issues/307 but it was closed unsolved i believe
Your Environment