【发布时间】:2020-12-02 22:47:47
【问题描述】:
这是我在 react native 中的组件,组件中的所有功能都运行良好。
import React from 'react';
import { View, Text } from 'react-native';
import { connect } from 'react-redux';
export class ABC extends React.Component {
render() {
return (
<View style={{ width: '100%', height: '100%', backgroundColor: '#ff22ff', justifyContent: 'center', alignItems: 'center' }}>
<Text style={{ color: '#000000' }}>{ this.props.data }</Text>
</View>
);
}
}
const mapStateToProps = (state) => {
return {
data: state.appReducer.hi
};
};
export default connect(mapStateToProps)(ABC);
我们如何测试一个连接的组件?我可以测试正常的组件。
【问题讨论】:
标签: reactjs react-native react-redux jestjs