diff --git a/src/content/reference/react-dom/hooks/useFormStatus.md b/src/content/reference/react-dom/hooks/useFormStatus.md index 0fc83e3e18..34da037cb3 100644 --- a/src/content/reference/react-dom/hooks/useFormStatus.md +++ b/src/content/reference/react-dom/hooks/useFormStatus.md @@ -4,7 +4,7 @@ title: useFormStatus -`useFormStatus` is a Hook that gives you status information of the last form submission. +`useFormStatus` — это хук, который предоставляет информацию о статусе последней отправки формы. ```js const { pending, data, method, action } = useFormStatus(); @@ -16,11 +16,11 @@ const { pending, data, method, action } = useFormStatus(); --- -## Reference {/*reference*/} +## Справочник {/*reference*/} ### `useFormStatus()` {/*use-form-status*/} -The `useFormStatus` Hook provides status information of the last form submission. +Хук `useFormStatus` предоставляет информацию о статусе последней отправки формы. ```js {5},[[1, 6, "status.pending"]] import { useFormStatus } from "react-dom"; @@ -40,42 +40,42 @@ export default function App() { } ``` -To get status information, the `Submit` component must be rendered within a `
`. The Hook returns information like the `pending` property which tells you if the form is actively submitting. +Чтобы получить информацию о статусе, компонент `Submit` должен быть отрисован внутри ``. Хук возвращает такую информацию, как свойство `pending`, которое указывает, происходит ли в данный момент отправка формы. -In the above example, `Submit` uses this information to disable `
; } function Form() { - // This is the `useFormStatus` tracks + // Это , который отслеживает `useFormStatus` return ( @@ -148,11 +148,11 @@ function Form() { -### Read the form data being submitted {/*read-form-data-being-submitted*/} +### Чтение отправляемых данных формы {/*read-form-data-being-submitted*/} -You can use the `data` property of the status information returned from `useFormStatus` to display what data is being submitted by the user. +Вы можете использовать свойство `data` информации о статусе, возвращаемой `useFormStatus`, чтобы отобразить, какие данные отправляются пользователем. -Here, we have a form where users can request a username. We can use `useFormStatus` to display a temporary status message confirming what username they have requested. +Здесь у нас есть форма, где пользователи могут запросить имя пользователя. Мы можем использовать `useFormStatus`, чтобы отобразить временное сообщение о статусе, подтверждающее, какое имя пользователя они запросили. @@ -215,16 +215,16 @@ button { ``` - + --- -## Troubleshooting {/*troubleshooting*/} +## Устранение неполадок {/*troubleshooting*/} -### `status.pending` is never `true` {/*pending-is-never-true*/} +### `status.pending` никогда не равен `true` {/*pending-is-never-true*/} -`useFormStatus` will only return status information for a parent ``. +`useFormStatus` будет возвращать информацию о статусе только для родительской формы ``. -If the component that calls `useFormStatus` is not nested in a ``, `status.pending` will always return `false`. Verify `useFormStatus` is called in a component that is a child of a `` element. +Если компонент, вызывающий `useFormStatus`, не вложен в ``, `status.pending` всегда будет возвращать `false`. Убедитесь, что `useFormStatus` вызывается в компоненте, который является дочерним элементом ``. -`useFormStatus` will not track the status of a `` rendered in the same component. See [Pitfall](#useformstatus-will-not-return-status-information-for-a-form-rendered-in-the-same-component) for more details. +`useFormStatus` не будет отслеживать статус формы ``, отрисованной в том же компоненте. Подробнее см. [Ограничение](#useformstatus-will-not-return-status-information-for-a-form-rendered-in-the-same-component). \ No newline at end of file