Skip to content

Commit da438fa

Browse files
author
edwardxiao
committed
- prevent option.msgOnError being cached.
1 parent 6d2b13c commit da438fa

11 files changed

+11
-11
lines changed

lib/components/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/react-inputs-validation.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-inputs-validation",
3-
"version": "4.4.1",
3+
"version": "4.4.2",
44
"description": "A react component for form inputs validation.",
55
"main": "index.js",
66
"repository": {

src/js/Inputs/Checkbox.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ const component: React.FC<Props> = ({
184184
setErr(err);
185185
setMsg(msg);
186186
validationCallback && validationCallback(err);
187-
}, []);
187+
}, [option.msgOnError]);
188188
useEffect(
189189
() => {
190190
if (validate) {

src/js/Inputs/Radiobox.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ const component: React.FC<Props> = ({
184184
setErr(err);
185185
setMsg(msg);
186186
validationCallback && validationCallback(err);
187-
}, []);
187+
}, [option.msgOnError]);
188188
useEffect(
189189
() => {
190190
if (validate) {

src/js/Inputs/Select.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ const component: React.FC<Props> = ({
282282
setErr(err);
283283
setMsg(msg);
284284
validationCallback && validationCallback(err);
285-
}, []);
285+
}, [option.msgOnError]);
286286
/* istanbul ignore next because of https://github.com/airbnb/enzyme/issues/441 && https://github.com/airbnb/enzyme/blob/master/docs/future.md */
287287
useEffect(() => {
288288
if (typeof window !== 'undefined') {

src/js/Inputs/Textarea.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ const component: React.FC<Props> = ({
280280
setErr(err);
281281
setMsg(msg);
282282
validationCallback && validationCallback(err);
283-
}, []);
283+
}, [option.msgOnError]);
284284
useEffect(
285285
() => {
286286
if (validate) {

src/js/Inputs/Textbox.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ const component: React.FC<Props> = ({
386386
setErr(err);
387387
setMsg(msg);
388388
validationCallback && validationCallback(err);
389-
}, []);
389+
}, [option.msgOnError]);
390390
useEffect(
391391
() => {
392392
if (validate) {

0 commit comments

Comments
 (0)