尝试过滤道具会引发TypeError:无法读取未定义的属性“ filter”

时间:2019-09-13 02:37:02

标签: javascript reactjs react-redux react-redux-firebase

执行mapStateToProps之后,我想根据数组中的元素过滤属性。但这会引发类型错误

const mapStateToProps = (state) => {
    console.log(state)
    return {
        hires: state.firestoreHires.ordered.hires
    }
}
const importHires = this.props.hires.filter(item => item.hireType == "import")

0 个答案:

没有答案