Comparing version 3.10.0 to 3.10.1
@@ -45,2 +45,9 @@ "use strict"; | ||
} | ||
// There are at least 4 places where we'd need to check, whether or not we | ||
// actually perform `setState` after the component gets unmounted. Instead, | ||
// we override it to hide the React warning. Also because React no longer | ||
// will raise it in the newer versions. | ||
// https://github.com/facebook/react/pull/22114 | ||
// https://github.com/vazco/uniforms/issues/1152 | ||
this.setState = () => { }; | ||
} | ||
@@ -47,0 +54,0 @@ getContext() { |
@@ -10,5 +10,12 @@ "use strict"; | ||
const context = react_1.useContext(context_1.context); | ||
invariant_1.default(context !== null, 'useForm must be used within a form.'); | ||
invariant_1.default(context !== null, `useForm must be used within a form. | ||
Two most common reasons for this error are: | ||
1. Component calling this function doesn't have a parent Form component in the tree. | ||
2. A duplicate uniforms dependency is installed in node_modules. | ||
For more info check FAQ: https://uniforms.tools/docs/faq/#useform-must-be-used-within-a-form | ||
`); | ||
return context; | ||
} | ||
exports.useForm = useForm; |
@@ -41,2 +41,9 @@ import clone from 'lodash/clone'; | ||
} | ||
// There are at least 4 places where we'd need to check, whether or not we | ||
// actually perform `setState` after the component gets unmounted. Instead, | ||
// we override it to hide the React warning. Also because React no longer | ||
// will raise it in the newer versions. | ||
// https://github.com/facebook/react/pull/22114 | ||
// https://github.com/vazco/uniforms/issues/1152 | ||
this.setState = () => { }; | ||
} | ||
@@ -43,0 +50,0 @@ getContext() { |
@@ -6,4 +6,11 @@ import invariant from 'invariant'; | ||
const context = useContext(contextReference); | ||
invariant(context !== null, 'useForm must be used within a form.'); | ||
invariant(context !== null, `useForm must be used within a form. | ||
Two most common reasons for this error are: | ||
1. Component calling this function doesn't have a parent Form component in the tree. | ||
2. A duplicate uniforms dependency is installed in node_modules. | ||
For more info check FAQ: https://uniforms.tools/docs/faq/#useform-must-be-used-within-a-form | ||
`); | ||
return context; | ||
} |
{ | ||
"name": "uniforms", | ||
"version": "3.10.0", | ||
"version": "3.10.1", | ||
"license": "MIT", | ||
@@ -44,3 +44,3 @@ "main": "./cjs/index.js", | ||
}, | ||
"gitHead": "74cd15102ff1684934115a9a998a2e0862b6fdc8" | ||
"gitHead": "37fa8c1e482cb9c3e8bd6e6395258634366b5d8a" | ||
} |
@@ -9,4 +9,14 @@ import invariant from 'invariant'; | ||
const context = useContext(contextReference); | ||
invariant(context !== null, 'useForm must be used within a form.'); | ||
invariant( | ||
context !== null, | ||
`useForm must be used within a form. | ||
Two most common reasons for this error are: | ||
1. Component calling this function doesn't have a parent Form component in the tree. | ||
2. A duplicate uniforms dependency is installed in node_modules. | ||
For more info check FAQ: https://uniforms.tools/docs/faq/#useform-must-be-used-within-a-form | ||
`, | ||
); | ||
return context; | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
221041
5140