Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use shouldError/shouldWarn by default unless only shouldValidate is passed in. #3881

Merged
merged 1 commit into from
Mar 2, 2018

Conversation

FMartinez4
Copy link
Contributor

When providing a custom shouldError prop, it needs to be passed into both shouldError and the deprecated shouldValidate.

const customShouldError = () => { ... };
const myForm = reduxForm({
  shouldError: customShouldError,
  shouldValidate: customShouldError,
});

If only shouldError is passed in the shouldValidate may override the expected behavior. For example the shouldError prop returns false but the default shouldValidate returns true, the code will still run the validation.

This PR will allow for either shouldError or shouldValidate to be used.

@codecov-io
Copy link

codecov-io commented Mar 1, 2018

Codecov Report

Merging #3881 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #3881   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          70      70           
  Lines        1601    1607    +6     
======================================
+ Hits         1601    1607    +6
Impacted Files Coverage Δ
src/createReduxForm.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 25ab6d9...c2baa2b. Read the comment docs.

@erikras erikras merged commit 3c53942 into redux-form:master Mar 2, 2018
@erikras
Copy link
Member

erikras commented Mar 2, 2018

Published in v7.3.0.

@lock
Copy link

lock bot commented Jun 1, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants