Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected reserved type number #75

Open
ChinaYangYan opened this issue Dec 19, 2019 · 19 comments
Open

Unexpected reserved type number #75

ChinaYangYan opened this issue Dec 19, 2019 · 19 comments

Comments

@ChinaYangYan
Copy link

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
Copy link

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

@potateprogrammer
Copy link

Its a dead package. Just use something else

@RainFalling1
Copy link

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

@Shelley
Copy link

Shelley commented Dec 26, 2019

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

@Shelley
Copy link

Shelley commented Dec 26, 2019

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

GregFrench added a commit to GregFrench/react-native-wheel-picker that referenced this issue Dec 27, 2019
@GregFrench
Copy link

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
Copy link

Rainsho commented May 13, 2020

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
Copy link

lujb commented May 13, 2020

@Rainsho Cool

@cparello
Copy link

@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.

  • Move data fetching code or side effects to componentDidUpdate.
  • If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
  • Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: WheelCurvedPicker

@GregFrench
Copy link

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
Copy link

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
Copy link

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

@danielkeithw
Copy link

It did! Thanks @GregFrench

@hungvu193
Copy link

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
Copy link

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
Copy link

@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
Copy link

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
Copy link

cparello commented Jul 10, 2023

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

@cparello
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests