From 3942ced320ae104f4c3238679f2c0d387ba9ddef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Figueredo?= <63759223+jpfigueredo@users.noreply.github.com> Date: Sat, 21 Nov 2026 16:03:38 -0300 Subject: [PATCH 1/2] =?UTF-8?q?Tradu=C3=A7=C3=A3o=20das=20se=C3=A7=C3=B5es?= =?UTF-8?q?=20restantes=20de=20`useTransition.md`=20para=20Portugu=C3=AAs?= =?UTF-8?q?=20(Brasil)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/content/reference/react/useTransition.md | 76 ++++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/content/reference/react/useTransition.md b/src/content/reference/react/useTransition.md index 87bc4da265..5fa48a0a7a 100644 --- a/src/content/reference/react/useTransition.md +++ b/src/content/reference/react/useTransition.md @@ -99,7 +99,7 @@ function SubmitButton({ submitAction }) { `startTransition` não possui valor de retorno. -#### Caveats {/*starttransition-caveats*/} +#### Ressalvas {/*starttransition-caveats*/} * `useTransition` é um Hook, portanto, deve ser chamado dentro de componentes ou Hooks personalizados. Se você precisar iniciar uma transição em outro lugar (por exemplo, a partir de uma biblioteca de dados), chame a função independente [`startTransition`](/reference/react/startTransition) em vez disso. @@ -199,8 +199,8 @@ export default function App({}) { const [isPending, startTransition] = useTransition(); const updateQuantityAction = async newQuantity => { - // To access the pending state of a transition, - // call startTransition again. + // Para acessar o estado pendente de uma transição, + // chame startTransition novamente. startTransition(async () => { const savedQuantity = await updateQuantity(newQuantity); startTransition(() => { @@ -225,7 +225,7 @@ import { startTransition } from "react"; export default function Item({action}) { function handleChange(event) { - // To expose an action prop, await the callback in startTransition. + // Para expor uma prop action, use await no callback dentro de startTransition. startTransition(async () => { await action(event.target.value); }) @@ -266,7 +266,7 @@ export default function Total({quantity, isPending}) { ```js src/api.js export async function updateQuantity(newQuantity) { return new Promise((resolve, reject) => { - // Simulate a slow network request. + // Simula uma requisição de rede lenta. setTimeout(() => { resolve(newQuantity); }, 2000); @@ -303,14 +303,14 @@ export async function updateQuantity(newQuantity) { -This is a basic example to demonstrate how Actions work, but this example does not handle requests completing out of order. When updating the quantity multiple times, it's possible for the previous requests to finish after later requests causing the quantity to update out of order. This is a known limitation that we will fix in the future (see [Troubleshooting](#my-state-updates-in-transitions-are-out-of-order) below). +Este é um exemplo básico para demonstrar como as Ações funcionam, mas ele não trata requisições que terminam fora de ordem. Ao atualizar a quantidade várias vezes, é possível que as requisições anteriores terminem depois das posteriores, fazendo a quantidade ser atualizada fora de ordem. Esta é uma limitação conhecida que vamos corrigir no futuro (veja [Solução de problemas](#my-state-updates-in-transitions-are-out-of-order) abaixo). -For common use cases, React provides built-in abstractions such as: +Para casos de uso comuns, o React fornece abstrações embutidas, como: - [`useActionState`](/reference/react/useActionState) -- [`