Skip to content

Commit 0ce66a2

Browse files
committed
Translate preload.md to Portuguese
1 parent 58b6e42 commit 0ce66a2

1 file changed

Lines changed: 40 additions & 40 deletions

File tree

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

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ title: preload
44

55
<Note>
66

7-
[React-based frameworks](/learn/start-a-new-react-project) frequently handle resource loading for you, so you might not have to call this API yourself. Consult your framework's documentation for details.
7+
[Frameworks baseados em React](/learn/start-a-new-react-project) frequentemente lidam com o carregamento de recursos para você, então você pode não precisar chamar esta API sozinho. Consulte a documentação de seu framework para obter detalhes.
88

99
</Note>
1010

1111
<Intro>
1212

13-
`preload` lets you eagerly fetch a resource such as a stylesheet, font, or external script that you expect to use.
13+
`preload` permite que você busque antecipadamente um recurso como uma stylesheet, fonte, ou script externo que você espera usar.
1414

1515
```js
1616
preload("https://example.com/font.woff2", {as: "font"});
@@ -22,11 +22,11 @@ preload("https://example.com/font.woff2", {as: "font"});
2222

2323
---
2424

25-
## Reference {/*reference*/}
25+
## Referência {/*reference*/}
2626

2727
### `preload(href, options)` {/*preload*/}
2828

29-
To preload a resource, call the `preload` function from `react-dom`.
29+
Para fazer o pré-carregamento (preload) de um recurso, chame a função `preload` de `react-dom`.
3030

3131
```js
3232
import { preload } from 'react-dom';
@@ -38,47 +38,47 @@ function AppRoot() {
3838

3939
```
4040

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

43-
The `preload` function provides the browser with a hint that it should start downloading the given resource, which can save time.
43+
A função `preload` fornece ao navegador uma dica de que ele deve começar a baixar o recurso fornecido, o que pode economizar tempo.
4444

45-
#### Parameters {/*parameters*/}
45+
#### Parâmetros {/*parameters*/}
4646

47-
* `href`: a string. The URL of the resource you want to download.
48-
* `options`: an object. It contains the following properties:
49-
* `as`: a required string. The type of resource. Its [possible values](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#as) are `audio`, `document`, `embed`, `fetch`, `font`, `image`, `object`, `script`, `style`, `track`, `video`, `worker`.
50-
* `crossOrigin`: a string. The [CORS policy](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) to use. Its possible values are `anonymous` and `use-credentials`. It is required when `as` is set to `"fetch"`.
51-
* `referrerPolicy`: a string. The [Referrer header](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#referrerpolicy) to send when fetching. Its possible values are `no-referrer-when-downgrade` (the default), `no-referrer`, `origin`, `origin-when-cross-origin`, and `unsafe-url`.
52-
* `integrity`: a string. A cryptographic hash of the resource, to [verify its authenticity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity).
53-
* `type`: a string. The MIME type of the resource.
54-
* `nonce`: a string. A cryptographic [nonce to allow the resource](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce) when using a strict Content Security Policy.
55-
* `fetchPriority`: a string. Suggests a relative priority for fetching the resource. The possible values are `auto` (the default), `high`, and `low`.
56-
* `imageSrcSet`: a string. For use only with `as: "image"`. Specifies the [source set of the image](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images).
57-
* `imageSizes`: a string. For use only with `as: "image"`. Specifies the [sizes of the image](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images).
47+
* `href`: uma string. A URL do recurso que você deseja baixar.
48+
* `options`: um objeto. Ele contém as seguintes propriedades:
49+
* `as`: uma string obrigatória. O tipo de recurso. Seus [valores possíveis](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#as) são `audio`, `document`, `embed`, `fetch`, `font`, `image`, `object`, `script`, `style`, `track`, `video`, `worker`.
50+
* `crossOrigin`: uma string. A [política CORS](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin) a ser usada. Seus valores possíveis são `anonymous` e `use-credentials`. É obrigatório quando `as` é definido como `"fetch"`.
51+
* `referrerPolicy`: uma string. O [cabeçalho Referrer](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#referrerpolicy) a ser enviado durante a busca. Seus valores possíveis são `no-referrer-when-downgrade` (o padrão), `no-referrer`, `origin`, `origin-when-cross-origin` e `unsafe-url`.
52+
* `integrity`: uma string. Um hash criptográfico do recurso, para [verificar sua autenticidade](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity).
53+
* `type`: uma string. O tipo MIME do recurso.
54+
* `nonce`: uma string. Um [nonce](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce) criptográfico para permitir o recurso ao usar uma Content Security Policy estrita.
55+
* `fetchPriority`: uma string. Sugere uma prioridade relativa para buscar o recurso. Os valores possíveis são `auto` (o padrão), `high` e `low`.
56+
* `imageSrcSet`: uma string. Para uso somente com `as: "image"`. Especifica o [conjunto de origem da imagem](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images).
57+
* `imageSizes`: uma string. Para uso somente com `as: "image"`. Especifica os [tamanhos da imagem](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images).
5858

59-
#### Returns {/*returns*/}
59+
#### Retorna {/*returns*/}
6060

61-
`preload` returns nothing.
61+
`preload` não retorna nada.
6262

63-
#### Caveats {/*caveats*/}
63+
#### Ressalvas {/*caveats*/}
6464

65-
* Multiple equivalent calls to `preload` have the same effect as a single call. Calls to `preload` are considered equivalent according to the following rules:
66-
* Two calls are equivalent if they have the same `href`, except:
67-
* If `as` is set to `image`, two calls are equivalent if they have the same `href`, `imageSrcSet`, and `imageSizes`.
68-
* In the browser, you can call `preload` in any situation: while rendering a component, in an Effect, in an event handler, and so on.
69-
* In server-side rendering or when rendering Server Components, `preload` 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.
65+
* Múltiplas chamadas equivalentes para `preload` têm o mesmo efeito que uma única chamada. As chamadas para `preload` são consideradas equivalentes de acordo com as seguintes regras:
66+
* Duas chamadas são equivalentes se tiverem o mesmo `href`, exceto:
67+
* Se `as` for definido como `image`, duas chamadas são equivalentes se tiverem o mesmo `href`, `imageSrcSet` e `imageSizes`.
68+
* No navegador, você pode chamar `preload` em qualquer situação: ao renderizar um componente, em um Effect, em um manipulador de eventos, e assim por diante.
69+
* Na renderização do lado do servidor ou ao renderizar componentes do servidor, `preload` só tem efeito se você o chamar ao renderizar um componente ou em um contexto assíncrono originado da renderização de um componente. Quaisquer outras chamadas serão ignoradas.
7070

7171
---
7272

73-
## Usage {/*usage*/}
73+
## Uso {/*usage*/}
7474

75-
### Preloading when rendering {/*preloading-when-rendering*/}
75+
### Preloading ao renderizar {/*preloading-when-rendering*/}
7676

77-
Call `preload` when rendering a component if you know that it or its children will use a specific resource.
77+
Chame `preload` ao renderizar um componente se souber que ele ou seus filhos usarão um recurso específico.
7878

79-
<Recipes titleText="Examples of preloading">
79+
<Recipes titleText="Exemplos de preloading">
8080

81-
#### Preloading an external script {/*preloading-an-external-script*/}
81+
#### Preloading um script externo {/*preloading-an-external-script*/}
8282

8383
```js
8484
import { preload } from 'react-dom';
@@ -89,11 +89,11 @@ function AppRoot() {
8989
}
9090
```
9191

92-
If you want the browser to start executing the script immediately (rather than just downloading it), use [`preinit`](/reference/react-dom/preinit) instead. If you want to load an ESM module, use [`preloadModule`](/reference/react-dom/preloadModule).
92+
Se você deseja que o navegador comece a executar o script imediatamente (em vez de apenas baixá-lo), use [`preinit`](/reference/react-dom/preinit) em vez disso. Se você deseja carregar um módulo ESM, use [`preloadModule`](/reference/react-dom/preloadModule).
9393

9494
<Solution />
9595

96-
#### Preloading a stylesheet {/*preloading-a-stylesheet*/}
96+
#### Preloading uma stylesheet {/*preloading-a-stylesheet*/}
9797

9898
```js
9999
import { preload } from 'react-dom';
@@ -104,11 +104,11 @@ function AppRoot() {
104104
}
105105
```
106106

107-
If you want the stylesheet to be inserted into the document immediately (which means the browser will start parsing it immediately rather than just downloading it), use [`preinit`](/reference/react-dom/preinit) instead.
107+
Se você deseja que a stylesheet seja inserida no documento imediatamente (o que significa que o navegador começará a analisá-la imediatamente em vez de apenas baixá-la), use [`preinit`](/reference/react-dom/preinit) em vez disso.
108108

109109
<Solution />
110110

111-
#### Preloading a font {/*preloading-a-font*/}
111+
#### Preloading uma fonte {/*preloading-a-font*/}
112112

113113
```js
114114
import { preload } from 'react-dom';
@@ -120,11 +120,11 @@ function AppRoot() {
120120
}
121121
```
122122

123-
If you preload a stylesheet, it's smart to also preload any fonts that the stylesheet refers to. That way, the browser can start downloading the font before it's downloaded and parsed the stylesheet.
123+
Se você fizer o preload de uma stylesheet, é inteligente também fazer o preload de quaisquer fontes às quais a stylesheet se refere. Dessa forma, o navegador pode começar a baixar a fonte antes de baixar e analisar a stylesheet.
124124

125125
<Solution />
126126

127-
#### Preloading an image {/*preloading-an-image*/}
127+
#### Preloading uma image {/*preloading-an-image*/}
128128

129129
```js
130130
import { preload } from 'react-dom';
@@ -139,15 +139,15 @@ function AppRoot() {
139139
}
140140
```
141141

142-
When preloading an image, the `imageSrcSet` and `imageSizes` options help the browser [fetch the correctly sized image for the size of the screen](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images).
142+
Ao fazer o preload de uma imagem, as opções `imageSrcSet` e `imageSizes` ajudam o navegador a [buscar a imagem com o tamanho correto para o tamanho da tela](https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images).
143143

144144
<Solution />
145145

146146
</Recipes>
147147

148-
### Preloading in an event handler {/*preloading-in-an-event-handler*/}
148+
### Preloading em um manipulador de eventos {/*preloading-in-an-event-handler*/}
149149

150-
Call `preload` 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.
150+
Chame `preload` 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.
151151

152152
```js
153153
import { preload } from 'react-dom';

0 commit comments

Comments
 (0)