-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Doc] Add i18n InputHelpterText section to Inputs/useInputs docs #9315
[Doc] Add i18n InputHelpterText section to Inputs/useInputs docs #9315
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
|
||
**Reminder:** [react-hook-form's `formState` is wrapped with a Proxy](https://react-hook-form.com/docs/useformstate/#rules) to improve render performance and skip extra computation if specific state is not subscribed. So, make sure you deconstruct or read the `formState` before render in order to enable the subscription. | ||
|
||
```js | ||
const { isDirty } = useFormState(); // ✅ | ||
const formState = useFormState(); // ❌ should deconstruct the formState | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we should keep this one. @fzaninotto?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's true that the reminder is mentioned twice in this chapter. I'd create a dedicated section explaining how to read the form state, and removing the reminder from the two sections avout TextField and Select.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djhi Do you want to do it or should I? Rock paper scissors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🪨 That's not really related to your PR so if you don't, we'll open a new PR for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on it then, after all, I broached it by removing the repeated section.
This seems to have turned into a real mess, probably because one of my local branches inadvertently targeted 'next' (?). If it's not easy enough to unspool on your end, let me know and I'll start over and copy my changes to a new PR. |
ad6f8b1
to
b8baede
Compare
@ZachSelindh I've fixed it for you. Should be good now. |
Thanks! |
This PR adds an i18n section to the Inputs.md doc instructing users on the use of the
InputHelperText
component.A tip referencing the use of said component has also been added to useInput.md.
I also removed a redundant
formState
reminder from useInput.mdThanks!