Skip to content

Commit

Permalink
Allow clearing alerts and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jlbelanger committed Oct 9, 2023
1 parent b71ae46 commit 0855a1e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 5 deletions.
11 changes: 11 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions dist/index.modern.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.modern.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/js/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ export default function Form({
const value = useMemo(() => ({
formState,
setFormState,
clearAlert: () => (setFormState({ ...formState, alertText: '', alertClass: '' })),
clearErrors: () => (setFormState({ ...formState, errors: {} })),
getDirtyKeys: () => (getDirtyKeys(formState.row, formState.originalRow)),
setValues,
}), [formState]);
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3145,9 +3145,9 @@ caniuse-api@^3.0.0:
lodash.uniq "^4.5.0"

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001312, caniuse-lite@^1.0.30001400:
version "1.0.30001538"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001538.tgz"
integrity sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw==
version "1.0.30001546"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001546.tgz"
integrity sha512-zvtSJwuQFpewSyRrI3AsftF6rM0X80mZkChIt1spBGEvRglCrjTniXvinc8JKRoqTwXAgvqTImaN9igfSMtUBw==

chalk@^1.0.0, chalk@^1.1.3:
version "1.1.3"
Expand Down

0 comments on commit 0855a1e

Please sign in to comment.