Open ChinaYangYan opened 4 years ago
i have same issue . "react-native": "0.61.5", "react-native-wheel-picker": "^1.2.0"
Its a dead package. Just use something else
@ChinaYangYan have you resolved the issue? I instead it by other package ,try to 'yarn add react-native-wheel-pick';
@ChinaYangYan did you solve this issue? I met the same issue :(
I fixed it by change "propTypes: {... " to "static propTypes = {...", I guess it's the react version issue maybe.
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!
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
@Rainsho Cool
@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.
npx react-codemod rename-unsafe-lifecycles
in your project source folder.Please update the following components: WheelCurvedPicker
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.
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.
Thank you for the suggestion. I have patched the library and published it to NPM. Hopefully, this fixes the issue.
It did! Thanks @GregFrench
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
I'm using "@gregfrench/react-native-wheel-picker": "^1.2.13"
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?
@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
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 .
you are probably not using the same version of node or react for this package, no commits for 6 years
error SyntaxError: \react-native-wheel-picker\WheelCurvedPicker.android.js: Unexpected reserved type number (39:22)
37 | textColor: ColorPropType, 38 |