Skip to content

Commit f1580f9

Browse files
Translate preconnect.md to Portuguese (#1030)
1 parent a0debfa commit f1580f9

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

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

+21-22
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: preconnect
44

55
<Intro>
66

7-
`preconnect` lets you eagerly connect to a server that you expect to load resources from.
7+
`preconnect` permite que você se conecte ansiosamente a um servidor do qual você espera carregar recursos.
88

99
```js
1010
preconnect("https://example.com");
@@ -16,11 +16,11 @@ preconnect("https://example.com");
1616

1717
---
1818

19-
## Reference {/*reference*/}
19+
## Referência {/*reference*/}
2020

2121
### `preconnect(href)` {/*preconnect*/}
2222

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

2525
```js
2626
import { preconnect } from 'react-dom';
@@ -32,34 +32,33 @@ function AppRoot() {
3232

3333
```
3434

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

37-
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.
37+
A função `preconnect` fornece ao navegador uma dica de que ele deve abrir uma conexão com o servidor fornecido. Se o navegador escolher fazê-lo, isso pode acelerar o carregamento de recursos desse servidor.
3838

39-
#### Parameters {/*parameters*/}
39+
#### Parâmetros {/*parameters*/}
4040

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

43+
#### Retorna {/*returns*/}
4344

44-
#### Returns {/*returns*/}
45+
`preconnect` não retorna nada.
4546

46-
`preconnect` returns nothing.
47+
#### Ressalvas {/*caveats*/}
4748

48-
#### Caveats {/*caveats*/}
49-
50-
* Multiple calls to `preconnect` with the same server have the same effect as a single call.
51-
* In the browser, you can call `preconnect` in any situation: while rendering a component, in an Effect, in an event handler, and so on.
52-
* 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.
53-
* 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.
54-
* 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.
49+
* Múltiplas chamadas para `preconnect` com o mesmo servidor têm o mesmo efeito de uma única chamada.
50+
* No navegador, você pode chamar `preconnect` em qualquer situação: ao renderizar um componente, em um Effect, em um manipulador de eventos, e assim por diante.
51+
* Na renderização do lado do servidor ou ao renderizar Server Components, `preconnect` só tem efeito se você chamá-lo ao renderizar um componente ou em um contexto assíncrono originado da renderização de um componente. Quaisquer outras chamadas serão ignoradas.
52+
* Se você sabe 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.
53+
* Não há benefício em pré-conectar ao mesmo servidor onde a própria página da web está hospedada, pois ela já foi conectada no momento em que a dica seria dada.
5554

5655
---
5756

58-
## Usage {/*usage*/}
57+
## Uso {/*usage*/}
5958

60-
### Preconnecting when rendering {/*preconnecting-when-rendering*/}
59+
### Pré-conexão ao renderizar {/*preconnecting-when-rendering*/}
6160

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

6463
```js
6564
import { preconnect } from 'react-dom';
@@ -70,9 +69,9 @@ function AppRoot() {
7069
}
7170
```
7271

73-
### Preconnecting in an event handler {/*preconnecting-in-an-event-handler*/}
72+
### Pré-conexão em um manipulador de eventos {/*preconnecting-in-an-event-handler*/}
7473

75-
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.
74+
Chame `preconnect` em um manipulador de eventos antes de fazer a transição 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.
7675

7776
```js
7877
import { preconnect } from 'react-dom';
@@ -86,4 +85,4 @@ function CallToAction() {
8685
<button onClick={onClick}>Start Wizard</button>
8786
);
8887
}
89-
```
88+
```

0 commit comments

Comments
 (0)