diff --git a/.changeset/heavy-deers-look.md b/.changeset/heavy-deers-look.md new file mode 100644 index 00000000..40134f17 --- /dev/null +++ b/.changeset/heavy-deers-look.md @@ -0,0 +1,5 @@ +--- +"react-cool-form": patch +--- + +Refactor: refine the warning of getting `values` only diff --git a/src/useForm.test.tsx b/src/useForm.test.tsx index 46c8441d..30bd96d9 100644 --- a/src/useForm.test.tsx +++ b/src/useForm.test.tsx @@ -144,7 +144,7 @@ describe("useForm", () => { mon("values"); expect(console.warn).toHaveBeenCalledTimes(1); expect(console.warn).toHaveBeenCalledWith( - '💡 react-cool-form > mon: Getting "values" alone might cause unnecessary re-renders. If you know what you\'re doing, please ignore this warning. See: https://react-cool-form.netlify.app/docs/getting-started/form-state#best-practices' + '💡 react-cool-form > mon: Getting "values" alone might cause unnecessary re-renders. If you know what you\'re doing, just ignore this warning. See: https://react-cool-form.netlify.app/docs/getting-started/form-state#best-practices' ); }); diff --git a/src/useForm.ts b/src/useForm.ts index 2d71984f..9d016afd 100644 --- a/src/useForm.ts +++ b/src/useForm.ts @@ -530,7 +530,7 @@ export default ({ !hasWarnValues.current ) { warn( - `💡 react-cool-form > ${methodName}: Getting "values" alone might cause unnecessary re-renders. If you know what you're doing, please ignore this warning. See: https://react-cool-form.netlify.app/docs/getting-started/form-state#best-practices` + `💡 react-cool-form > ${methodName}: Getting "values" alone might cause unnecessary re-renders. If you know what you're doing, just ignore this warning. See: https://react-cool-form.netlify.app/docs/getting-started/form-state#best-practices` ); hasWarnValues.current = true; } diff --git a/src/useFormState.test.tsx b/src/useFormState.test.tsx index f8ada524..25f40a6c 100644 --- a/src/useFormState.test.tsx +++ b/src/useFormState.test.tsx @@ -72,7 +72,7 @@ describe("useFormState", () => { console.warn = jest.fn(); renderHelper({ path: "values" }); expect(console.warn).toHaveBeenCalledWith( - '💡 react-cool-form > useFormState: Getting "values" alone might cause unnecessary re-renders. If you know what you\'re doing, please ignore this warning. See: https://react-cool-form.netlify.app/docs/getting-started/form-state#best-practices' + '💡 react-cool-form > useFormState: Getting "values" alone might cause unnecessary re-renders. If you know what you\'re doing, just ignore this warning. See: https://react-cool-form.netlify.app/docs/getting-started/form-state#best-practices' ); });