react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[DatePicker] 0.12.0-rc gives: `DatePickerIOS` has no propType for native prop `RCTDatePicker.onChange` of native type `BOOL`

Open olofd opened this issue 11 years ago • 21 comments

I upgraded from 0.11.0 to 0.12.0-rc and now I get: DatePickerIOS has no propType for native prop RCTDatePicker.onChange of native type BOOL

I've leaned the project in xcode and reset the simulator, but to no wail. Can't see that I'm doing anything wrong.

olofd avatar Sep 30 '15 18:09 olofd

Can you share with us the code you use for the DatePickerIOS stuff? Because I don't have any problem with my code or UIExplorer.

Crash-- avatar Oct 01 '15 11:10 Crash--

@olofd - you should clean your build with cmd+shift+k from Xcode and run it again. It looks like your native code is stale, because onChange is type RCTBubblingEventBlock on 0.12.0-rc and not BOOL

brentvatne avatar Oct 01 '15 18:10 brentvatne

You were right! My bad! Sry!

olofd avatar Oct 01 '15 18:10 olofd

I also have this issue, even after cmd+shift+k. Is there another level of staleness that cmd+shift+K might not clean?

mschipperheyn avatar Oct 03 '15 16:10 mschipperheyn

This is the offending code. I have 0.12.0-rc

var RCTDatePickerIOS = requireNativeComponent('RCTDatePicker', DatePickerIOS, { nativeOnly: { onChange: true }, });

Wondering if it might have anything to do with project being created against 0.11.4?

mschipperheyn avatar Oct 03 '15 17:10 mschipperheyn

Exactly same problem, and cmd+shift+k doesn't help, https://github.com/facebook/react-native/blob/master/Libraries/Components/DatePicker/DatePickerIOS.ios.js#L149 And last modification of the file https://github.com/facebook/react-native/commit/33036b1f01c1e3816745bfe9c243a478445559ee Thoughts ? edit: I clean my project with following methods

  • Command+Option+Shift+K
  • Command+Shift+K
  • Clean derived data from Window -> projects
  • "Reset Contents And Settings" in iOS simulator

and still same error

alfonsodev avatar Oct 05 '15 21:10 alfonsodev

Ok for me the problem was solved closing packager terminal, cleaning project and running packager by myself. @mschipperheyn give it a try. this was caused because I opened a old react 0.11 project, and then went back to different project 0.12 without closing packager process. I hope it helps.

alfonsodev avatar Oct 05 '15 21:10 alfonsodev

Just upgraded from 0.11.4 to 0.12. Still can't make the error disappear using those methods @brentvatne @alfonsodev

When I removed DatePickerIOS: require('DatePickerIOS'), on react-native.js, another error appears : ScrollView has no propType for native prop RCTScrollView.snapToAlignment of native type NSString

Is this still stale native code?

alvingarcia avatar Oct 09 '15 09:10 alvingarcia

@alvingarcia make sure you stop any existing packager terminal, clean from XCode and that you don't use an old bundle. Also I would even recommend a complete rm -rf node_modules if it still don't work.

gre avatar Oct 09 '15 09:10 gre

@alvingarcia also check that new packager process that you run is actually running , sometimes it can fail on starting because for instance you have a chrome debugger session opened.

alfonsodev avatar Oct 09 '15 14:10 alfonsodev

Just upgraded to 0.12.0 and started to notice this as well. I cleared all node_modules, cleaned out the build and reset content and settings for the simulator but still couldn't get it to work.

I even double checked and the code being executed was what @brentvatne mentioned earlier with it being RCTBubblingEventBlock.

Finally ended up just restarting my computer and now everything is working fine.

christopherdro avatar Oct 09 '15 22:10 christopherdro

Facing the same problem on 0.12.0

xinthink avatar Oct 10 '15 08:10 xinthink

same problem here

andresbravog avatar Oct 13 '15 21:10 andresbravog

same here, too. restarted the system as @christopherdro said and it started working fine.

kenfdev avatar Oct 14 '15 15:10 kenfdev

same here. tried restating the packeger , cleaning and nothing

ohadperry avatar Oct 14 '15 20:10 ohadperry

@ohadpartuck Did you try restarting your computer?

christopherdro avatar Oct 14 '15 20:10 christopherdro

Seeing this same issue with a brand new react native integration to an existing applicaiton. Using nothing but simple view demos

iammerrick avatar Oct 16 '15 16:10 iammerrick

I run this, which I have in my .bash_profile, which deletes XCode derived data. It’s the location where Xcode stores all kinds of intermediate build results, generated indexes, etc.

ddd() { #Save the starting dir startingDir=$PWD #Go to the derivedData cd ~/Library/Developer/Xcode/DerivedData #Sometimes, 1 file remains, so loop until no files remain numRemainingFiles=1 while [ $numRemainingFiles -gt 0 ]; do #Delete the files, recursively rm -rf * #Update file count numRemainingFiles=ls | wc -l done echo Done #Go back to starting dir cd $startingDir }

then I restarted XCode, cleaned, removed app from Simulator

restarted packager

then rebuilt

It works fine now (at least for me) but this needs to be traced to the root cause and resolved properly

idibidiart avatar Oct 16 '15 17:10 idibidiart

@christopherdro yes, tried now. still nothing. also tried @idibidiart solution.

ohadperry avatar Oct 17 '15 07:10 ohadperry

Check with 'ps aux' is still any packager process running? Also when packager starts have a look to the output, it can fail when starting. On Oct 17, 2015 09:27, "Ohad Partuck" [email protected] wrote:

@christopherdro https://github.com/christopherdro yes, tried now. still nothing. also tried @idibidiart https://github.com/idibidiart solution.

— Reply to this email directly or view it on GitHub https://github.com/facebook/react-native/issues/3154#issuecomment-148892833 .

alfonsodev avatar Oct 17 '15 08:10 alfonsodev