You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.
What would you like to be added:
When placing a custom component that uses Unform's useField hook, this component is required to be a child of a <Form> component. If it's not, a rather cryptic error message is thrown in the console.
To reproduce:
go to the live example of the Basic Form in the documentation here
in the live code example, replace the <Form> element with a <div> (be sure to also change the closing tag)
The following error will be thrown: 'TypeError: t is undefined', where t could be another letter depending on minification.
Why is this needed:
While this error is triggered by a developer mistake (why use the Input when there's no parent form), but it's an easy mistake to make. And because this error is so cryptic, it takes way longer to figure out what I did wrong than it needs to be.
Instead of thowing this error, replace it with something more descriptive. For example: useField called by a component that is not a child of a <Form>. Please make sure this component is a child of a <Form>.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
What would you like to be added:
When placing a custom component that uses Unform's
useField
hook, this component is required to be a child of a<Form>
component. If it's not, a rather cryptic error message is thrown in the console.To reproduce:
<Form>
element with a<div>
(be sure to also change the closing tag)t
could be another letter depending on minification.Why is this needed:
While this error is triggered by a developer mistake (why use the Input when there's no parent form), but it's an easy mistake to make. And because this error is so cryptic, it takes way longer to figure out what I did wrong than it needs to be.
Instead of thowing this error, replace it with something more descriptive. For example:
useField called by a component that is not a child of a <Form>. Please make sure this component is a child of a <Form>.
The text was updated successfully, but these errors were encountered: