Open Hoshiiii2602 opened 2 months ago
Hi! π
Firstly, thanks for your work on this project! π
Today I used patch-package to patch react-native-wheel-pick@1.2.2 for the project I'm working on.
react-native-wheel-pick@1.2.2
Here is the diff that solved my problem:
diff --git a/node_modules/react-native-wheel-pick/src/picker.js b/node_modules/react-native-wheel-pick/src/picker.js index f86dd33..9de2733 100644 --- a/node_modules/react-native-wheel-pick/src/picker.js +++ b/node_modules/react-native-wheel-pick/src/picker.js @@ -46,11 +46,11 @@ export default class Picker extends Component { }; validateDeprecateProps = (oldProp = 'curtain', newProp = '') => { - if(this.props){ - if(typeof this.props[oldProp] !== 'undefined'){ + if (this.props) { + if (typeof this.props[oldProp] !== 'undefined') { this.props[oldProp] = undefined; - if(newProp === ''){ + if (newProp === '') { console.warn(`react-native-wheel-pick : "${oldProp}" Prop was deprecated. Please remove it for improve native performance.`) } else { console.warn(`react-native-wheel-pick : "${oldProp}" Prop was deprecated. Please use "${newProp}" instead.`) @@ -59,10 +59,16 @@ export default class Picker extends Component { } } + componentDidUpdate(prevProps) { + if (prevProps.selectedValue !== this.props.selectedValue) { + this.setState({ selectedValue: this.props.selectedValue }); + } + } + render() { const { pickerData, style, ...props } = this.props; - if(Platform.OS === 'android'){ + if (Platform.OS === 'android') { //checkDeprecatedProp this.validateDeprecateProps('atmospheric'); this.validateDeprecateProps('curved');
This issue body was partially generated by patch-package.
Hi! π
Firstly, thanks for your work on this project! π
Today I used patch-package to patch
react-native-wheel-pick@1.2.2
for the project I'm working on.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.