mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-01-12 22:51:09 +08:00
[fix] React warning when using hitSlop prop
Make sure the hitSlop element has a 'key'. Fix #743
This commit is contained in:
@@ -65,8 +65,7 @@ class View extends Component<ViewProps> {
|
||||
if (hitSlop) {
|
||||
const hitSlopStyle = calculateHitSlopStyle(hitSlop);
|
||||
const hitSlopChild = createElement('span', { style: [styles.hitSlop, hitSlopStyle] });
|
||||
otherProps.children = React.Children.toArray(otherProps.children);
|
||||
otherProps.children.unshift(hitSlopChild);
|
||||
otherProps.children = React.Children.toArray([ hitSlopChild, otherProps.children ]);
|
||||
}
|
||||
|
||||
return createElement('div', otherProps);
|
||||
|
||||
Reference in New Issue
Block a user