lesliesam / react-native-wheel-picker

338 stars 321 forks source link

Unexpected reserved type number #75

Open ChinaYangYan opened 4 years ago

ChinaYangYan commented 4 years ago

error SyntaxError: \react-native-wheel-picker\WheelCurvedPicker.android.js: Unexpected reserved type number (39:22)

37 | textColor: ColorPropType, 38 |

39 | textSize: PropTypes.number, | ^ 40 | 41 | itemStyle: PropTypes.object,

RainFalling1 commented 4 years ago

i have same issue . "react-native": "0.61.5", "react-native-wheel-picker": "^1.2.0"

potateprogrammer commented 4 years ago

Its a dead package. Just use something else

RainFalling1 commented 4 years ago

@ChinaYangYan have you resolved the issue? I instead it by other package ,try to 'yarn add react-native-wheel-pick';

Shelley commented 4 years ago

@ChinaYangYan did you solve this issue? I met the same issue :(

Shelley commented 4 years ago

I fixed it by change "propTypes: {... " to "static propTypes = {...", I guess it's the react version issue maybe.

GregFrench commented 4 years ago

Since this repo hasn't had any updates in 2 years, I went ahead and forked the repo and published the fork using Shelley's suggestion of updating the propTypes.

You can view the updated repo at https://github.com/GregFrench/react-native-wheel-picker and install it using the command: npm i @gregfrench/react-native-wheel-picker

This should fix your problem. Let me know if it helps.

Cheers!

Rainsho commented 4 years ago

We have a project use react-native-wheel-picker, it works ok for half a year. Recently, we got this error. After a completely re-check, we found it may relate to babel, since we import other libs to our project, @babel/core has been upgrade to 7.9.6. After we downgrade @babel/core to 7.6.4 (used before) and other related presets to older version, this error has been solved.

Hope, this info is useful. @ChinaYangYan

lujb commented 4 years ago

@Rainsho Cool

cparello commented 4 years ago

@GregFrench any motivation to update the forked repo

[Fri Jun 12 2020 12:14:21.378] WARN Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-unsafe-component-lifecycles for details.

Please update the following components: WheelCurvedPicker

GregFrench commented 4 years ago

Can you explain what this is? Is this a warning message you get when using the latest version of React Native? Would be able to send a pull request with the updated changes and I'll take a look at it? I'm not really up to date on the latest versions of React/React Native so I'm not quite sure what changes would need to be made in order to remove the warning message while also having it still work on older versions of React Native. Thanks.

danielkeithw commented 4 years ago

Thanks for forking this Greg

WheelCurvedPicker.ios.js

componentWillReceiveProps (props) {   this.setState(this._stateFromProps(props));  }

becomes

UNSAFE_componentWillReceiveProps (props) {   this.setState(this._stateFromProps(props)); }

That makes it fully backwards compatible.

GregFrench commented 4 years ago

Thank you for the suggestion. I have patched the library and published it to NPM. Hopefully, this fixes the issue.

danielkeithw commented 4 years ago

It did! Thanks @GregFrench

hungvu193 commented 3 years ago

Hi @GregFrench , I'm facing with this issue on Android

Error while updating property 'data' of a view managed by: WheelCurvedPicker
null
Value for value  cannot be case from string to double
Screen Shot 2021-05-24 at 11 57 48

I'm using "@gregfrench/react-native-wheel-picker": "^1.2.13"

GregFrench commented 3 years ago

It looks like the problem is occurring with "selectedValue={values[name] || value}" line. Is it possible you are using values with types of String instead of Number in your values array?

hungvu193 commented 3 years ago

@GregFrench yes, I think so, but sometimes the value should be String, so I think we need to improve this. I choose another library for Android side, btw

sundardsTechMind commented 1 year ago

import React, {Component} from 'react'; import PropTypes from 'prop-types';

type Props = { AuthSignUpReducer: PropTypes.any, authSignUpReset: PropTypes.func, authSignUpDismissMessages: PropTypes.func, };

For me it's throwing Syntax error can anyone help me with this .

cparello commented 1 year ago

you are probably not using the same version of node or react for this package, no commits for 6 years

cparello commented 1 year ago

https://www.npmjs.com/package/react-native-wheel-pick