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。有什么我想念的吗?