roto93 / react-native-neat-date-picker

An easy to use date picker for react native.
MIT License
50 stars 29 forks source link

Add React import #21

Closed blorent closed 1 year ago

blorent commented 1 year ago

Hi, I'm testing out your date picker. Small issue, I had to add imports of "React from 'react'" in all your tsx files in order to make it work with my project. Maybe I did something wrong when including it, but it solved the issue

roto93 commented 1 year ago

Hi, thank you for reporting this. What is the version of React you are using? If it is earlier than React 17 then it's necessary to import react manually. But that reminds me not all projects use the latest version so I will update the package these days.

cunger commented 1 year ago

I also get the error "Can't find variable: React" with the following versions:

"react": "18.1.0",
"react-native": "0.70.5",
"react-native-neat-date-picker": "^1.4.7",

It points to NeatDatePicker.tsx line 313 (where you use Modal).

Adding React to the imports from 'react' indeed solves it.

roto93 commented 1 year ago

Sorry, got busy on other stuff. thanks to drisbhi's PR #25 that added the react import