有没有任何方法可用作基于Bootstrap4 scss的构建的一部分,为每个引导类添加前缀css并js避免名称冲突.
我使用过https://github.com/faucamp/bootstrap_namespace_prefixer
但是这只支持基于bootstrap3的css和js文件.
我创建了一个组合组件来将 TouchableNativeFeedback 组合到 wrapperComponent。
export default function withFeedback2(
WrappedComponent
) {
return class extends BaseComponent {
constructor(props) {
super(props);
}
render() {
return (
<View>
<TouchableNativeFeedback
onPress={() => this.props.onContainerViewPress()}
>
<WrappedComponent {...this.props} />
</TouchableNativeFeedback>
{/* <TouchableOpacity
onPress={this.props.onContainerViewPress ? () => this.props.onContainerViewPress() : null}
>
<WrappedComponent {...this.props} />
</TouchableOpacity> */}
</View>
);
}
};
}
Run Code Online (Sandbox Code Playgroud)
但是TochableNativeFeedback 的 OnPress事件没有触发。而 OnPress 事件被正确触发,并且如果 wrappercomponent 包装在 TouchableOpacity 下,则调用 wrappercomponent 的onContainerViewPress道具。
我正在 Android 平台上对此进行测试。
react-native react-native-android touchableopacity react-navigation touchablewithoutfeedback