How to check whether form of react redux form is valid or not?

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

I have written this code in my selector.js

I imported in my index.js as

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

And used it as

const valid = this.props.valid;

The const valid always return true even if form is invalid. Is there something i am missing??

0 Answers
Related