Skip to content
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

Merged
merged 6 commits into from
Sep 28, 2023

Conversation

ZachSelindh
Copy link
Contributor

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.md

Thanks!

Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment on lines -102 to -109

**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
```

Copy link
Collaborator

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?

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@ZachSelindh
Copy link
Contributor Author

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.

@slax57 slax57 force-pushed the add-helptertext-section-to-inputs branch from ad6f8b1 to b8baede Compare September 28, 2023 07:50
@slax57
Copy link
Contributor

slax57 commented Sep 28, 2023

@ZachSelindh I've fixed it for you. Should be good now.

@djhi
Copy link
Collaborator

djhi commented Sep 28, 2023

Thanks!

@djhi djhi merged commit 7b8186f into marmelab:master Sep 28, 2023
2 checks passed
@djhi djhi added this to the 4.14.4 milestone Sep 28, 2023
@slax57 slax57 changed the title Add i18n InputHelpterText section to Inputs/useInputs docs [Doc] Add i18n InputHelpterText section to Inputs/useInputs docs Sep 28, 2023
@ZachSelindh ZachSelindh deleted the add-helptertext-section-to-inputs branch September 28, 2023 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants