Skip to content

Commit 1d1a2f3

Browse files
committed
Translate preconnect.md to pt-br
1 parent 7148d38 commit 1d1a2f3

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

src/content/reference/react-dom/preconnect.md

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ canary: true
55

66
<Canary>
77

8-
The `preconnect` function is currently only available in React's Canary and experimental channels. Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
8+
A função `preconnect` está atualmente disponível apenas nos canais Canary e experimentais do React. Saiba mais sobre [os canais de lançamento do React aqui](/community/versioning-policy#all-release-channels).
99

1010
</Canary>
1111

1212
<Intro>
1313

14-
`preconnect` lets you eagerly connect to a server that you expect to load resources from.
14+
`preconnect` permite que você faça uma conexão antecipada com um servidor do qual você espera carregar recursos.
1515

1616
```js
1717
preconnect("https://example.com");
@@ -23,11 +23,11 @@ preconnect("https://example.com");
2323

2424
---
2525

26-
## Reference {/*reference*/}
26+
## Referência {/*reference*/}
2727

2828
### `preconnect(href)` {/*preconnect*/}
2929

30-
To preconnect to a host, call the `preconnect` function from `react-dom`.
30+
Para pré-conectar a um host, chame a função `preconnect` de `react-dom`.
3131

3232
```js
3333
import { preconnect } from 'react-dom';
@@ -39,34 +39,33 @@ function AppRoot() {
3939

4040
```
4141

42-
[See more examples below.](#usage)
42+
[Veja mais exemplos abaixo.](#usage)
4343

44-
The `preconnect` function provides the browser with a hint that it should open a connection to the given server. If the browser chooses to do so, this can speed up the loading of resources from that server.
44+
A função `preconnect` fornece ao navegador uma sugestão de que ele deve abrir uma conexão com o servidor fornecido. Se o navegador optar por fazer isso, isso pode acelerar o carregamento de recursos desse servidor.
4545

46-
#### Parameters {/*parameters*/}
46+
#### Parâmetros {/*parameters*/}
4747

48-
* `href`: a string. The URL of the server you want to connect to.
48+
* `href`: uma string. A URL do servidor com o qual você deseja se conectar.
4949

50+
#### Retorna {/*returns*/}
5051

51-
#### Returns {/*returns*/}
52+
`preconnect` não retorna nada.
5253

53-
`preconnect` returns nothing.
54+
#### Ressalvas {/*caveats*/}
5455

55-
#### Caveats {/*caveats*/}
56-
57-
* Multiple calls to `preconnect` with the same server have the same effect as a single call.
58-
* In the browser, you can call `preconnect` in any situation: while rendering a component, in an Effect, in an event handler, and so on.
59-
* In server-side rendering or when rendering Server Components, `preconnect` only has an effect if you call it while rendering a component or in an async context originating from rendering a component. Any other calls will be ignored.
60-
* If you know the specific resources you'll need, you can call [other functions](/reference/react-dom/#resource-preloading-apis) instead that will start loading the resources right away.
61-
* There is no benefit to preconnecting to the same server the webpage itself is hosted from because it's already been connected to by the time the hint would be given.
56+
* Chamadas múltiplas para `preconnect` com o mesmo servidor têm o mesmo efeito que uma única chamada.
57+
* No navegador, você pode chamar `preconnect` em qualquer situação: durante a renderização de um componente, em um Effect, em um manipulador de eventos, e assim por diante.
58+
* Na renderização do lado do servidor ou ao renderizar Componentes do Servidor, `preconnect` só tem efeito se você chamá-lo enquanto renderiza um componente ou em um contexto assíncrono originado da renderização de um componente. Qualquer outra chamada será ignorada.
59+
* Se você souber os recursos específicos de que precisará, pode chamar [outras funções](/reference/react-dom/#resource-preloading-apis) em vez disso, que começarão a carregar os recursos imediatamente.
60+
* Não há benefício em pré-conectar ao mesmo servidor em que a própria página da web está hospedada, pois ela já foi conectada no momento em que a sugestão seria dada.
6261

6362
---
6463

65-
## Usage {/*usage*/}
64+
## Uso {/*usage*/}
6665

67-
### Preconnecting when rendering {/*preconnecting-when-rendering*/}
66+
### Pré-conectando ao renderizar {/*preconnecting-when-rendering*/}
6867

69-
Call `preconnect` when rendering a component if you know that its children will load external resources from that host.
68+
Chame `preconnect` ao renderizar um componente se você souber que seus filhos carregarão recursos externos daquele host.
7069

7170
```js
7271
import { preconnect } from 'react-dom';
@@ -77,9 +76,9 @@ function AppRoot() {
7776
}
7877
```
7978

80-
### Preconnecting in an event handler {/*preconnecting-in-an-event-handler*/}
79+
### Pré-conectando em um manipulador de eventos {/*preconnecting-in-an-event-handler*/}
8180

82-
Call `preconnect` in an event handler before transitioning to a page or state where external resources will be needed. This gets the process started earlier than if you call it during the rendering of the new page or state.
81+
Chame `preconnect` em um manipulador de eventos antes de transitar para uma página ou estado onde recursos externos serão necessários. Isso inicia o processo mais cedo do que se você o chamasse durante a renderização da nova página ou estado.
8382

8483
```js
8584
import { preconnect } from 'react-dom';
@@ -90,7 +89,7 @@ function CallToAction() {
9089
startWizard();
9190
}
9291
return (
93-
<button onClick={onClick}>Start Wizard</button>
92+
<button onClick={onClick}>Iniciar Assistente</button>
9493
);
9594
}
96-
```
95+
```

0 commit comments

Comments
 (0)