Skip to content

Commit 89b708e

Browse files
committed
fix(Picker):解决picker选择第一项,后面的其他项数据不变更的bug
1 parent 8701050 commit 89b708e

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

example/examples/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
"react-native-image-viewing": "~0.2.2",
2424
"react-native-safe-area-context": "~4.3.1",
2525
"react-native-screens": "~3.15.0",
26-
"react-native-svg": "13.0.0",
27-
"react-native-reanimated":"3.1.0"
26+
"react-native-svg": "13.9.0"
2827
},
2928
"devDependencies": {
3029
"@babel/core": "~7.20.7",
@@ -54,4 +53,4 @@
5453
"node"
5554
]
5655
}
57-
}
56+
}

packages/core/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@
6565
"prop-types": "15.7.2",
6666
"react-native-gesture-handler": "2.8.0",
6767
"react-native-root-siblings": "4.1.1",
68-
"react-native-svg": "13.0.0",
69-
"react-native-safe-area-context":"4.5.1",
70-
"react-native-reanimated":"3.1.0"
68+
"react-native-svg": "13.9.0"
7169
},
7270
"peerDependencies": {
7371
"react": ">=16.9.0",
@@ -81,4 +79,4 @@
8179
"engines": {
8280
"node": ">=16.0.0"
8381
}
84-
}
82+
}

packages/core/src/Picker/components/WheelPicker/WheelPickerItem.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ function WheelPickerItem({ textStyle, style, visibleRest, height, option, index,
4949
</Animated.View>
5050
);
5151
}
52-
export default memo(WheelPickerItem, () => true);
53-
52+
export default memo(WheelPickerItem, (prevProps, nextProps) => {
53+
return prevProps.option === nextProps.option;
54+
});
5455
const styles = StyleSheet.create({
5556
option: {
5657
alignItems: 'center',

website/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"react-native-gesture-handler": "2.8.0",
3636
"react-native-reanimated": "~2.13.0",
3737
"react-native-root-siblings": "4.1.1",
38-
"react-native-svg": "13.0.0",
38+
"react-native-svg": "13.9.0",
3939
"react-native-web": "0.18.10",
4040
"react-router-dom": "6.2.1",
4141
"styled-components": "^5.3.6",
@@ -76,4 +76,4 @@
7676
"last 1 safari version"
7777
]
7878
}
79-
}
79+
}

0 commit comments

Comments
 (0)