mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-02 23:02:16 +00:00
run hitTest only if necessary
This commit is contained in:
@@ -29,7 +29,7 @@ export default function(props, options = {stroke: true, transform: true, fill: t
|
||||
}
|
||||
|
||||
if (options.transform) {
|
||||
extractedProps.transform = extractTransform(props);
|
||||
extractedProps.trans = extractTransform(props);
|
||||
}
|
||||
|
||||
if (options.responder) {
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
import {responderPropsKeys} from '../props';
|
||||
import {responderProps} from '../props';
|
||||
import _ from 'lodash';
|
||||
|
||||
export default function (props) {
|
||||
return _.pick(props, responderPropsKeys);
|
||||
let touchable;
|
||||
|
||||
return _.reduce(props, (prev, value, key) => {
|
||||
if (value && responderProps[key]) {
|
||||
prev[key] = value;
|
||||
|
||||
if (!touchable) {
|
||||
touchable = true;
|
||||
prev.touchable = true;
|
||||
}
|
||||
}
|
||||
|
||||
return prev;
|
||||
}, {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user