如何检查反应形式是否有效?

时间:2017-07-05 06:14:21

标签: reactjs react-redux react-redux-form

const selectFormAndCheckDirty  = () => (state) => isDirty('basic')(state);
const selectFormAndCheckPristine  = () => (state) => isPristine('basic')(state);
const selectFormAndValid  = () => (state) => isValid('basic')(state);

我已经在我的selector.js

中编写了这段代码

我在index.js中导入为

const mapStateToProps = createStructuredSelector({
    valid: selectFormAndValid(),
    dirty: selectFormAndCheckDirty(),
    pristine: selectFormAndCheckPristine()
});

并将其用作

const valid = this.props.valid;

即使表单无效,const有效也始终返回true。有什么我想念的吗?

0 个答案:

没有答案