По какой-то причине мой компонент без членства allEmployees не отображается, и я не могу понять, почему. Я получаю следующее предупреждение:My Stateless Компонент не рендеринга (Reactjs и Redux)
Неизвестный опорок employeesData
на <allEmployees>
тег. Снимите эту опору с элемента.
Контейнер
class employeeListPage extends React.Component {
constructor(props) {
super(props);
this.state = {
employees : {}
};
}
render(){
return(
<div>
<allEmployees employeesData = {this.props.employees} />
</div>
)
}
}
function mapStateToProps(state, ownProps){
return{
employees: state.employees
}
}
function mapDispatchToProps(dispatch){
return {
employeeActions : bindActionCreators(employeeActions, dispatch)
};
}
export default connect(mapStateToProps, mapDispatchToProps)(employeeListPage);
allEmployees Компонент
const allEmployees = (props) => (
<div>
<table>
<thead>
<tr>
<th>Employee Number</th>
<th>Employee Full Name</th>
<th>Active Employee</th>
<th>Origin</th>
<th>Modify</th>
<th>Remove</th>
</tr>
</thead>
<tbody>
{props.employeesData.map(employee => {
<tr>
<td>{employee.Number}</td>
<td>{employee.FullName}</td>
<td>{employee.IsActive}</td>
<td>{employee.Origin}</td>
<td><button>Modify</button></td>
<td><button>Remove</button></td>
</tr>
})};
</tbody>
</table>
</div>
);
export default allEmployees;
Вышеупомянутый ответ вы задаете или хотите, чтобы я добавил что-нибудь? –