我有一个带有图像的本机 Web 应用程序。我想做平移和缩放,所以我尝试用 react-native-pan-zoom 模块中的 ImageZoom 包装它。
<ImageZoom
cropWidth={Dimensions.get('window').width}
cropHeight={Dimensions.get('window').height}
imageWidth={200}
imageHeight={200}
>
<Image source={`/EventMaps/${name}`} style={styles.image} resizeMode="center" />
</ImageZoom>
但是得到一个编译错误
./node_modules/react-native-image-pan-zoom/built/image-zoom/image-zoom.component.js
Module parse failed: Unexpected token (555:16)
You may need an appropriate loader to handle this file type.
| ]
| };
| return (<react_native_1.View style={__assign({}, image_zoom_style_1.default.container, this.props.style, { width: this.props.cropWidth, height: this.props.cropHeight })}
{...this.imagePanResponder.panHandlers}>
| <react_native_1.Animated.View style={animateConf}>
| <react_native_1.View onLayout={this.handleLayout.bind(this)} style={{
这应该工作吗?