` DOM node is removed, React will call your the cleanup function returned from the callback.
+Quando o nó DOM `
` é adicionado à tela, React chamará seu callback `ref` com o `node` DOM como argumento. Quando esse nó DOM `
` for removido, React chamará sua função de limpeza retornada do callback.
-React will also call your `ref` callback whenever you pass a *different* `ref` callback. In the above example, `(node) => { ... }` is a different function on every render. When your component re-renders, the *previous* function will be called with `null` as the argument, and the *next* function will be called with the DOM node.
+React também chamará seu callback `ref` sempre que você passar um callback `ref` *diferente*. No exemplo acima, `(node) => { ... }` é uma função diferente a cada renderização. Quando seu componente renderizar novamente, a função *anterior* será chamada com `null` como argumento, e a função *seguinte* será chamada com o nó DOM.
-#### Parameters {/*ref-callback-parameters*/}
+#### Parâmetros {/*ref-callback-parameters*/}
-* `node`: A DOM node. React will pass you the DOM node when the ref gets attached. Unless you pass the same function reference for the `ref` callback on every render, the callback will get temporarily cleanup and re-create during every re-render of the component.
+* `node`: Um nó DOM. React passará o nó DOM quando a ref for anexada. A menos que você passe a mesma referência de função para o callback `ref` em cada renderização, o callback será temporariamente limpo e recriado durante cada nova renderização do componente.
-#### React 19 added cleanup functions for `ref` callbacks. {/*react-19-added-cleanup-functions-for-ref-callbacks*/}
+#### O React 19 adicionou funções de limpeza para callbacks `ref`. {/*react-19-added-cleanup-functions-for-ref-callbacks*/}
-To support backwards compatibility, if a cleanup function is not returned from the `ref` callback, `node` will be called with `null` when the `ref` is detached. This behavior will be removed in a future version.
+Para dar suporte à compatibilidade com versões anteriores, se uma função de limpeza não for retornada do callback `ref`, `node` será chamada com `null` quando a `ref` for desanexada. Esse comportamento será removido em uma versão futura.
-#### Returns {/*returns*/}
+#### Retorna {/*returns*/}
-* **optional** `cleanup function`: When the `ref` is detached, React will call the cleanup function. If a function is not returned by the `ref` callback, React will call the callback again with `null` as the argument when the `ref` gets detached. This behavior will be removed in a future version.
+* **opcional** `função de limpeza`: Quando a `ref` é desanexada, React chamará a função de limpeza. Se uma função não for retornada pelo callback `ref`, React chamará o callback novamente com `null` como argumento quando a `ref` for desanexada. Esse comportamento será removido em uma versão futura.
-#### Caveats {/*caveats*/}
+#### Ressalvas {/*caveats*/}
-* When Strict Mode is on, React will **run one extra development-only setup+cleanup cycle** before the first real setup. This is a stress-test that ensures that your cleanup logic "mirrors" your setup logic and that it stops or undoes whatever the setup is doing. If this causes a problem, implement the cleanup function.
-* When you pass a *different* `ref` callback, React will call the *previous* callback's cleanup function if provided. If no cleanup function is defined, the `ref` callback will be called with `null` as the argument. The *next* function will be called with the DOM node.
+* Quando o Modo Strict está ativado, React irá **executar um ciclo extra de configuração + limpeza apenas para desenvolvimento** antes da primeira configuração real. Este é um teste de estresse que garante que sua lógica de limpeza "espelhe" sua lógica de configuração e que ele pare ou desfaça o que a configuração está fazendo. Se isso causar um problema, implemente a função de limpeza.
+* Quando você passa um callback `ref` *diferente*, React chamará a função de limpeza do callback *anterior*, se fornecida. Se nenhuma função de limpeza for definida, o callback `ref` será chamado com `null` como argumento. A função *seguinte* será chamada com o nó DOM.
---
-### React event object {/*react-event-object*/}
+### Objeto de evento React {/*react-event-object*/}
-Your event handlers will receive a *React event object.* It is also sometimes known as a "synthetic event".
+Seus manipuladores de eventos receberão um *objeto de evento React.* Ele também é às vezes conhecido como um "evento sintético".
```js
{
- console.log(e); // React event object
+ console.log(e); // Objeto de evento React
}} />
```
-It conforms to the same standard as the underlying DOM events, but fixes some browser inconsistencies.
+Ele está em conformidade com o mesmo padrão dos eventos DOM subjacentes, mas corrige algumas inconsistências do navegador.
-Some React events do not map directly to the browser's native events. For example in `onMouseLeave`, `e.nativeEvent` will point to a `mouseout` event. The specific mapping is not part of the public API and may change in the future. If you need the underlying browser event for some reason, read it from `e.nativeEvent`.
+Alguns eventos React não se mapeiam diretamente para os eventos nativos do navegador. Por exemplo, em `onMouseLeave`, `e.nativeEvent` apontará para um evento `mouseout`. O mapeamento específico não faz parte da API pública e pode mudar no futuro. Se você precisar do evento do navegador subjacente por algum motivo, leia-o de `e.nativeEvent`.
-#### Properties {/*react-event-object-properties*/}
+#### Propriedades {/*react-event-object-properties*/}
-React event objects implement some of the standard [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event) properties:
+Os objetos de evento React implementam algumas das propriedades [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event) padrão:
-* [`bubbles`](https://developer.mozilla.org/en-US/docs/Web/API/Event/bubbles): A boolean. Returns whether the event bubbles through the DOM.
-* [`cancelable`](https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelable): A boolean. Returns whether the event can be canceled.
-* [`currentTarget`](https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget): A DOM node. Returns the node to which the current handler is attached in the React tree.
-* [`defaultPrevented`](https://developer.mozilla.org/en-US/docs/Web/API/Event/defaultPrevented): A boolean. Returns whether `preventDefault` was called.
-* [`eventPhase`](https://developer.mozilla.org/en-US/docs/Web/API/Event/eventPhase): A number. Returns which phase the event is currently in.
-* [`isTrusted`](https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted): A boolean. Returns whether the event was initiated by user.
-* [`target`](https://developer.mozilla.org/en-US/docs/Web/API/Event/target): A DOM node. Returns the node on which the event has occurred (which could be a distant child).
-* [`timeStamp`](https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp): A number. Returns the time when the event occurred.
+* [`bubbles`](https://developer.mozilla.org/en-US/docs/Web/API/Event/bubbles): Um booleano. Retorna se o evento se propaga pelo DOM.
+* [`cancelable`](https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelable): Um booleano. Retorna se o evento pode ser cancelado.
+* [`currentTarget`](https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget): Um nó DOM. Retorna o nó ao qual o manipulador atual está anexado na árvore React.
+* [`defaultPrevented`](https://developer.mozilla.org/en-US/docs/Web/API/Event/defaultPrevented): Um booleano. Retorna se `preventDefault` foi chamado.
+* [`eventPhase`](https://developer.mozilla.org/en-US/docs/Web/API/Event/eventPhase): Um número. Retorna em qual fase o evento está no momento.
+* [`isTrusted`](https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted): Um booleano. Retorna se o evento foi iniciado pelo usuário.
+* [`target`](https://developer.mozilla.org/en-US/docs/Web/API/Event/target): Um nó DOM. Retorna o nó em que o evento ocorreu (que pode ser um filho distante).
+* [`timeStamp`](https://developer.mozilla.org/en-US/docs/Web/API/Event/timeStamp): Um número. Retorna o tempo em que o evento ocorreu.
-Additionally, React event objects provide these properties:
+Além disso, os objetos de evento React fornecem essas propriedades:
-* `nativeEvent`: A DOM [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event). The original browser event object.
+* `nativeEvent`: Um [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event) DOM. O objeto de evento original do navegador.
-#### Methods {/*react-event-object-methods*/}
+#### Métodos {/*react-event-object-methods*/}
-React event objects implement some of the standard [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event) methods:
+Os objetos de evento React implementam alguns dos métodos [`Event`](https://developer.mozilla.org/en-US/docs/Web/API/Event) padrão:
-* [`preventDefault()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault): Prevents the default browser action for the event.
-* [`stopPropagation()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation): Stops the event propagation through the React tree.
+* [`preventDefault()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault): Impede a ação padrão do navegador para o evento.
+* [`stopPropagation()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation): Interrompe a propagação do evento pela árvore React.
-Additionally, React event objects provide these methods:
+Além disso, os objetos de evento React fornecem esses métodos:
-* `isDefaultPrevented()`: Returns a boolean value indicating whether `preventDefault` was called.
-* `isPropagationStopped()`: Returns a boolean value indicating whether `stopPropagation` was called.
-* `persist()`: Not used with React DOM. With React Native, call this to read event's properties after the event.
-* `isPersistent()`: Not used with React DOM. With React Native, returns whether `persist` has been called.
+* `isDefaultPrevented()`: Retorna um valor booleano indicando se `preventDefault` foi chamado.
+* `isPropagationStopped()`: Retorna um valor booleano indicando se `stopPropagation` foi chamado.
+* `persist()`: Não usado com React DOM. Com React Native, chame isso para ler as propriedades do evento após o evento.
+* `isPersistent()`: Não usado com React DOM. Com React Native, retorna se `persist` foi chamado.
-#### Caveats {/*react-event-object-caveats*/}
+#### Ressalvas {/*react-event-object-caveats*/}
-* The values of `currentTarget`, `eventPhase`, `target`, and `type` reflect the values your React code expects. Under the hood, React attaches event handlers at the root, but this is not reflected in React event objects. For example, `e.currentTarget` may not be the same as the underlying `e.nativeEvent.currentTarget`. For polyfilled events, `e.type` (React event type) may differ from `e.nativeEvent.type` (underlying type).
+* Os valores de `currentTarget`, `eventPhase`, `target` e `type` refletem os valores que seu código React espera. Por baixo dos panos, React anexa manipuladores de eventos na raiz, mas isso não é refletido em objetos de evento React. Por exemplo, `e.currentTarget` pode não ser o mesmo que o `e.nativeEvent.currentTarget` subjacente. Para eventos polyfilled, `e.type` (tipo de evento React) pode diferir de `e.nativeEvent.type` (tipo subjacente).
---
-### `AnimationEvent` handler function {/*animationevent-handler*/}
+### Função do manipulador `AnimationEvent` {/*animationevent-handler*/}
-An event handler type for the [CSS animation](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animations/Using_CSS_animations) events.
+Um tipo de manipulador de eventos para os eventos [animação CSS](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Animations/Using_CSS_animations).
```js
```
-#### Parameters {/*animationevent-handler-parameters*/}
+#### Parâmetros {/*animationevent-handler-parameters*/}
-* `e`: A [React event object](#react-event-object) with these extra [`AnimationEvent`](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent) properties:
+* `e`: Um [objeto de evento React](#react-event-object) com estas propriedades extras [`AnimationEvent`](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent):
* [`animationName`](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent/animationName)
* [`elapsedTime`](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent/elapsedTime)
* [`pseudoElement`](https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent/pseudoElement)
---
-### `ClipboardEvent` handler function {/*clipboadevent-handler*/}
+### Função do manipulador `ClipboardEvent` {/*clipboadevent-handler*/}
-An event handler type for the [Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API) events.
+Um tipo de manipulador de eventos para os eventos da [API Clipboard](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API).
```js
```
-#### Parameters {/*clipboadevent-handler-parameters*/}
-
-* `e`: A [React event object](#react-event-object) with these extra [`ClipboardEvent`](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent) properties:
+#### Parâmetros {/*clipboadevent-handler-parameters*/}
+* `e`: Um [objeto de evento React](#react-event-object) com estas propriedades extras [`ClipboardEvent`](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent):
* [`clipboardData`](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent/clipboardData)
---
-### `CompositionEvent` handler function {/*compositionevent-handler*/}
+### Função do manipulador `CompositionEvent` {/*compositionevent-handler*/}
-An event handler type for the [input method editor (IME)](https://developer.mozilla.org/en-US/docs/Glossary/Input_method_editor) events.
+Um tipo de manipulador de eventos para os eventos do [editor de método de entrada (IME)](https://developer.mozilla.org/en-US/docs/Glossary/Input_method_editor).
```js
```
-#### Parameters {/*compositionevent-handler-parameters*/}
+#### Parâmetros {/*compositionevent-handler-parameters*/}
-* `e`: A [React event object](#react-event-object) with these extra [`CompositionEvent`](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent) properties:
+* `e`: Um [objeto de evento React](#react-event-object) com estas propriedades extras [`CompositionEvent`](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent):
* [`data`](https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent/data)
---
-### `DragEvent` handler function {/*dragevent-handler*/}
+### Função do manipulador `DragEvent` {/*dragevent-handler*/}
-An event handler type for the [HTML Drag and Drop API](https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API) events.
+Um tipo de manipulador de eventos para os eventos da [API HTML Drag and Drop](https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API).
```js
<>
@@ -406,7 +404,7 @@ An event handler type for the [HTML Drag and Drop API](https://developer.mozilla
onDragStart={e => console.log('onDragStart')}
onDragEnd={e => console.log('onDragEnd')}
>
- Drag source
+ Origem da arrastada
{ e.preventDefault(); console.log('onDragOver'); }}
onDrop={e => console.log('onDrop')}
>
- Drop target
+ Alvo da soltura
>
```
-#### Parameters {/*dragevent-handler-parameters*/}
+#### Parâmetros {/*dragevent-handler-parameters*/}
-* `e`: A [React event object](#react-event-object) with these extra [`DragEvent`](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent) properties:
+* `e`: Um [objeto de evento React](#react-event-object) com estas propriedades extras [`DragEvent`](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent):
* [`dataTransfer`](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent/dataTransfer)
-
- It also includes the inherited [`MouseEvent`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent) properties:
-
+
+ Ele também inclui as propriedades [`MouseEvent`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent) herdadas:
+
* [`altKey`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/altKey)
* [`button`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button)
* [`buttons`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons)
@@ -444,16 +442,16 @@ An event handler type for the [HTML Drag and Drop API](https://developer.mozilla
* [`screenY`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/screenY)
* [`shiftKey`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/shiftKey)
- It also includes the inherited [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent) properties:
+ Ele também inclui as propriedades [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent) herdadas:
* [`detail`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail)
* [`view`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/view)
---
-### `FocusEvent` handler function {/*focusevent-handler*/}
+### Função do manipulador `FocusEvent` {/*focusevent-handler*/}
-An event handler type for the focus events.
+Um tipo de manipulador de eventos para os eventos de foco.
```js
```
-[See an example.](#handling-focus-events)
+[Veja um exemplo.](#handling-focus-events)
-#### Parameters {/*focusevent-handler-parameters*/}
+#### Parâmetros {/*focusevent-handler-parameters*/}
-* `e`: A [React event object](#react-event-object) with these extra [`FocusEvent`](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent) properties:
+* `e`: Um [objeto de evento React](#react-event-object) com estas propriedades extras [`FocusEvent`](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent):
* [`relatedTarget`](https://developer.mozilla.org/en-US/docs/Web/API/FocusEvent/relatedTarget)
- It also includes the inherited [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent) properties:
+ Ele também inclui as propriedades [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent) herdadas:
* [`detail`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail)
* [`view`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/view)
---
-### `Event` handler function {/*event-handler*/}
+### Função do manipulador `Event` {/*event-handler*/}
-An event handler type for generic events.
+Um tipo de manipulador de eventos para eventos genéricos.
-#### Parameters {/*event-handler-parameters*/}
+#### Parâmetros {/*event-handler-parameters*/}
-* `e`: A [React event object](#react-event-object) with no additional properties.
+* `e`: Um [objeto de evento React](#react-event-object) sem propriedades adicionais.
---
-### `InputEvent` handler function {/*inputevent-handler*/}
+### Função do manipulador `InputEvent` {/*inputevent-handler*/}
-An event handler type for the `onBeforeInput` event.
+Um tipo de manipulador de eventos para o evento `onBeforeInput`.
```js
console.log('onBeforeInput')} />
```
-#### Parameters {/*inputevent-handler-parameters*/}
+#### Parâmetros {/*inputevent-handler-parameters*/}
-* `e`: A [React event object](#react-event-object) with these extra [`InputEvent`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent) properties:
+* `e`: Um [objeto de evento React](#react-event-object) com estas propriedades extras [`InputEvent`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent):
* [`data`](https://developer.mozilla.org/en-US/docs/Web/API/InputEvent/data)
---
-### `KeyboardEvent` handler function {/*keyboardevent-handler*/}
+### Função do manipulador `KeyboardEvent` {/*keyboardevent-handler*/}
-An event handler type for keyboard events.
+Um tipo de manipulador de eventos para eventos de teclado.
```js
```
-[See an example.](#handling-keyboard-events)
+[Veja um exemplo.](#handling-keyboard-events)
-#### Parameters {/*keyboardevent-handler-parameters*/}
+#### Parâmetros {/*keyboardevent-handler-parameters*/}
-* `e`: A [React event object](#react-event-object) with these extra [`KeyboardEvent`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent) properties:
+* `e`: Um [objeto de evento React](#react-event-object) com estas propriedades extras [`KeyboardEvent`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent):
* [`altKey`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/altKey)
* [`charCode`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/charCode)
* [`code`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code)
@@ -531,16 +529,16 @@ An event handler type for keyboard events.
* [`shiftKey`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/shiftKey)
* [`which`](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/which)
- It also includes the inherited [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent) properties:
+ Ele também inclui as propriedades [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent) herdadas:
* [`detail`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail)
* [`view`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/view)
---
-### `MouseEvent` handler function {/*mouseevent-handler*/}
+### Função do manipulador `MouseEvent` {/*mouseevent-handler*/}
-An event handler type for mouse events.
+Um tipo de manipulador de eventos para eventos de mouse.
```js
```
-[See an example.](#handling-mouse-events)
+[Veja um exemplo.](#handling-mouse-events)
-#### Parameters {/*mouseevent-handler-parameters*/}
+#### Parâmetros {/*mouseevent-handler-parameters*/}
-* `e`: A [React event object](#react-event-object) with these extra [`MouseEvent`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent) properties:
+* `e`: Um [objeto de evento React](#react-event-object) com estas propriedades extras [`MouseEvent`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent):
* [`altKey`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/altKey)
* [`button`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button)
* [`buttons`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons)
@@ -575,16 +573,16 @@ An event handler type for mouse events.
* [`screenY`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/screenY)
* [`shiftKey`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/shiftKey)
- It also includes the inherited [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent) properties:
+ Ele também inclui as propriedades [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent) herdadas:
* [`detail`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail)
* [`view`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/view)
---
-### `PointerEvent` handler function {/*pointerevent-handler*/}
+### Função do manipulador `PointerEvent` {/*pointerevent-handler*/}
-An event handler type for [pointer events.](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events)
+Um tipo de manipulador de eventos para [eventos de ponteiro.](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events)
```js
```
-[See an example.](#handling-pointer-events)
+[Veja um exemplo.](#handling-pointer-events)
-#### Parameters {/*pointerevent-handler-parameters*/}
+#### Parâmetros {/*pointerevent-handler-parameters*/}
-* `e`: A [React event object](#react-event-object) with these extra [`PointerEvent`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent) properties:
+* `e`: Um [objeto de evento React](#react-event-object) com estas propriedades extras [`PointerEvent`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent):
* [`height`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/height)
* [`isPrimary`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/isPrimary)
* [`pointerId`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/pointerId)
@@ -612,8 +610,8 @@ An event handler type for [pointer events.](https://developer.mozilla.org/en-US/
* [`twist`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/twist)
* [`width`](https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/width)
- It also includes the inherited [`MouseEvent`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent) properties:
-
+ Ele também inclui as propriedades [`MouseEvent`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent) herdadas:
+
* [`altKey`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/altKey)
* [`button`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button)
* [`buttons`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons)
@@ -631,16 +629,16 @@ An event handler type for [pointer events.](https://developer.mozilla.org/en-US/
* [`screenY`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/screenY)
* [`shiftKey`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/shiftKey)
- It also includes the inherited [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent) properties:
+ Ele também inclui as propriedades herdadas do [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent):
* [`detail`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail)
* [`view`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/view)
---
-### `TouchEvent` handler function {/*touchevent-handler*/}
+### Função manipuladora de eventos `TouchEvent` {/*touchevent-handler*/}
-An event handler type for [touch events.](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events)
+Um tipo de manipulador de eventos para [eventos de toque.](https://developer.mozilla.org/en-US/docs/Web/API/Touch_events)
```js
```
-#### Parameters {/*touchevent-handler-parameters*/}
+#### Parâmetros {/*touchevent-handler-parameters*/}
-* `e`: A [React event object](#react-event-object) with these extra [`TouchEvent`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent) properties:
+* `e`: Um [objeto de evento React](#react-event-object) com estas propriedades extras do [`TouchEvent`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent):
* [`altKey`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/altKey)
* [`ctrlKey`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/ctrlKey)
* [`changedTouches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/changedTouches)
@@ -662,17 +660,17 @@ An event handler type for [touch events.](https://developer.mozilla.org/en-US/do
* [`shiftKey`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/shiftKey)
* [`touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches)
* [`targetTouches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/targetTouches)
-
- It also includes the inherited [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent) properties:
+
+ Ele também inclui as propriedades herdadas do [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent):
* [`detail`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail)
* [`view`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/view)
---
-### `TransitionEvent` handler function {/*transitionevent-handler*/}
+### Função manipuladora do evento `TransitionEvent` {/*transitionevent-handler*/}
-An event handler type for the CSS transition events.
+Um tipo de manipulador de eventos para os eventos de transição CSS.
```js
```
-#### Parameters {/*transitionevent-handler-parameters*/}
+#### Parâmetros {/*transitionevent-handler-parameters*/}
-* `e`: A [React event object](#react-event-object) with these extra [`TransitionEvent`](https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent) properties:
+* `e`: Um [objeto de evento React](#react-event-object) com estas propriedades extras do [`TransitionEvent`](https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent):
* [`elapsedTime`](https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent/elapsedTime)
* [`propertyName`](https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent/propertyName)
* [`pseudoElement`](https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent/pseudoElement)
---
-### `UIEvent` handler function {/*uievent-handler*/}
+### Função manipuladora de eventos `UIEvent` {/*uievent-handler*/}
-An event handler type for generic UI events.
+Um tipo de manipulador de eventos para eventos de UI genéricos.
```js
```
-#### Parameters {/*uievent-handler-parameters*/}
+#### Parâmetros {/*uievent-handler-parameters*/}
-* `e`: A [React event object](#react-event-object) with these extra [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent) properties:
- * [`detail`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail)
- * [`view`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/view)
+* `e`: Um [objeto de evento React](#react-event-object) com estas propriedades extras do [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent):
+ * [`detail`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail)
+ * [`view`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/view)
---
-### `WheelEvent` handler function {/*wheelevent-handler*/}
+### Função manipuladora de eventos `WheelEvent` {/*wheelevent-handler*/}
-An event handler type for the `onWheel` event.
+Um tipo de manipulador de eventos para o evento `onWheel`.
```js
```
-#### Parameters {/*wheelevent-handler-parameters*/}
+#### Parâmetros {/*wheelevent-handler-parameters*/}
-* `e`: A [React event object](#react-event-object) with these extra [`WheelEvent`](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent) properties:
+* `e`: Um [objeto de evento React](#react-event-object) com estas propriedades extras do [`WheelEvent`](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent):
* [`deltaMode`](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/deltaMode)
* [`deltaX`](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/deltaX)
* [`deltaY`](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/deltaY)
* [`deltaZ`](https://developer.mozilla.org/en-US/docs/Web/API/WheelEvent/deltaZ)
-
- It also includes the inherited [`MouseEvent`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent) properties:
+ Ele também inclui as propriedades herdadas do [`MouseEvent`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent):
* [`altKey`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/altKey)
* [`button`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button)
@@ -745,35 +742,35 @@ An event handler type for the `onWheel` event.
* [`screenY`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/screenY)
* [`shiftKey`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/shiftKey)
- It also includes the inherited [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent) properties:
+ Ele também inclui as propriedades herdadas do [`UIEvent`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent):
* [`detail`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/detail)
* [`view`](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/view)
---
-## Usage {/*usage*/}
+## Uso {/*usage*/}
-### Applying CSS styles {/*applying-css-styles*/}
+### Aplicando estilos CSS {/*applying-css-styles*/}
-In React, you specify a CSS class with [`className`.](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) It works like the `class` attribute in HTML:
+No React, você especifica uma classe CSS com [`className`.](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) Ele funciona como o atributo `class` em HTML:
```js
```
-Then you write the CSS rules for it in a separate CSS file:
+Então você escreve as regras CSS correspondentes em um arquivo CSS separado:
```css
-/* In your CSS */
+/* No seu CSS */
.avatar {
border-radius: 50%;
}
```
-React does not prescribe how you add CSS files. In the simplest case, you'll add a [`
`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) tag to your HTML. If you use a build tool or a framework, consult its documentation to learn how to add a CSS file to your project.
+O React não prescreve como você adiciona arquivos CSS. No caso mais simples, você adicionará uma tag [`
`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link) ao seu HTML. Se você usar uma ferramenta de build ou um framework, consulte sua documentação para aprender como adicionar um arquivo CSS ao seu projeto.
-Sometimes, the style values depend on data. Use the `style` attribute to pass some styles dynamically:
+Às vezes, os valores de estilo dependem de dados. Use o atributo `style` para passar alguns estilos dinamicamente:
```js {3-6}
```
-
-In the above example, `style={{}}` is not a special syntax, but a regular `{}` object inside the `style={ }` [JSX curly braces.](/learn/javascript-in-jsx-with-curly-braces) We recommend only using the `style` attribute when your styles depend on JavaScript variables.
+No exemplo acima, `style={{}}` não é uma sintaxe especial, mas um objeto `{}` regular dentro da `style={ }` [chaves JSX.](/learn/javascript-in-jsx-with-curly-braces) Recomendamos usar o atributo `style` apenas quando seus estilos dependem de variáveis JavaScript.
@@ -830,13 +826,13 @@ export default function Avatar({ user }) {
-#### How to apply multiple CSS classes conditionally? {/*how-to-apply-multiple-css-classes-conditionally*/}
+#### Como aplicar várias classes CSS condicionalmente? {/*how-to-apply-multiple-css-classes-conditionally*/}
-To apply CSS classes conditionally, you need to produce the `className` string yourself using JavaScript.
+Para aplicar classes CSS condicionalmente, você precisa produzir a string `className` você mesmo usando JavaScript.
-For example, `className={'row ' + (isSelected ? 'selected': '')}` will produce either `className="row"` or `className="row selected"` depending on whether `isSelected` is `true`.
+Por exemplo, `className={'row ' + (isSelected ? 'selected': '')}` produzirá `className="row"` ou `className="row selected"` dependendo se `isSelected` é `true`.
-To make this more readable, you can use a tiny helper library like [`classnames`:](https://github.com/JedWatson/classnames)
+Para tornar isso mais legível, você pode usar uma pequena biblioteca auxiliar como [`classnames`:](https://github.com/JedWatson/classnames)
```js
import cn from 'classnames';
@@ -850,7 +846,7 @@ function Row({ isSelected }) {
}
```
-It is especially convenient if you have multiple conditional classes:
+É especialmente conveniente se você tiver várias classes condicionais:
```js
import cn from 'classnames';
@@ -872,11 +868,11 @@ function Row({ isSelected, size }) {
---
-### Manipulating a DOM node with a ref {/*manipulating-a-dom-node-with-a-ref*/}
+### Manipulando um nó DOM com uma ref {/*manipulating-a-dom-node-with-a-ref*/}
-Sometimes, you'll need to get the browser DOM node associated with a tag in JSX. For example, if you want to focus an ` ` when a button is clicked, you need to call [`focus()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) on the browser ` ` DOM node.
+Às vezes, você precisará obter o nó DOM do navegador associado a uma tag em JSX. Por exemplo, se você deseja focar em um ` ` quando um botão é clicado, você precisa chamar [`focus()`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus) no nó DOM ` ` do navegador.
-To obtain the browser DOM node for a tag, [declare a ref](/reference/react/useRef) and pass it as the `ref` attribute to that tag:
+Para obter o nó DOM do navegador para uma tag, [declare uma ref](/reference/react/useRef) e passe-a como o atributo `ref` para essa tag:
```js {7}
import { useRef } from 'react';
@@ -889,7 +885,7 @@ export default function Form() {
// ...
```
-React will put the DOM node into `inputRef.current` after it's been rendered to the screen.
+O React colocará o nó DOM em `inputRef.current` depois que ele for renderizado na tela.
@@ -916,24 +912,24 @@ export default function Form() {
-Read more about [manipulating DOM with refs](/learn/manipulating-the-dom-with-refs) and [check out more examples.](/reference/react/useRef#examples-dom)
+Leia mais sobre [manipulação de DOM com refs](/learn/manipulating-the-dom-with-refs) e [verifique mais exemplos.](/reference/react/useRef#examples-dom)
-For more advanced use cases, the `ref` attribute also accepts a [callback function.](#ref-callback)
+Para casos de uso mais avançados, o atributo `ref` também aceita uma [função callback.](#ref-callback)
---
-### Dangerously setting the inner HTML {/*dangerously-setting-the-inner-html*/}
+### Definindo perigosamente o HTML interno {/*dangerously-setting-the-inner-html*/}
-You can pass a raw HTML string to an element like so:
+Você pode passar uma string HTML bruta para um elemento da seguinte forma:
```js
const markup = { __html: 'some raw html
' };
return
;
```
-**This is dangerous. As with the underlying DOM [`innerHTML`](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML) property, you must exercise extreme caution! Unless the markup is coming from a completely trusted source, it is trivial to introduce an [XSS](https://en.wikipedia.org/wiki/Cross-site_scripting) vulnerability this way.**
+**Isto é perigoso. Como acontece com a propriedade [`innerHTML`](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML) DOM subjacente, você deve ter extrema cautela! A menos que a marcação seja proveniente de uma fonte totalmente confiável, é trivial introduzir uma vulnerabilidade [XSS](https://pt.wikipedia.org/wiki/Cross-site_scripting) dessa maneira.**
-For example, if you use a Markdown library that converts Markdown to HTML, you trust that its parser doesn't contain bugs, and the user only sees their own input, you can display the resulting HTML like this:
+Por exemplo, se você usar uma biblioteca Markdown que converte Markdown em HTML, você confia que seu analisador não contenha bugs, e o usuário só vê sua própria entrada, você pode exibir o HTML resultante assim:
@@ -942,11 +938,11 @@ import { useState } from 'react';
import MarkdownPreview from './MarkdownPreview.js';
export default function MarkdownEditor() {
- const [postContent, setPostContent] = useState('_Hello,_ **Markdown**!');
+ const [postContent, setPostContent] = useState('_Olá,_ **Markdown**!');
return (
<>
- Enter some markdown:
+ Digite algum markdown:
-The `{__html}` object should be created as close to where the HTML is generated as possible, like the above example does in the `renderMarkdownToHTML` function. This ensures that all raw HTML being used in your code is explicitly marked as such, and that only variables that you expect to contain HTML are passed to `dangerouslySetInnerHTML`. It is not recommended to create the object inline like `
`.
+O objeto `{__html}` deve ser criado o mais próximo possível de onde o HTML é gerado, como o exemplo acima faz na função `renderMarkdownToHTML`. Isso garante que todo o HTML bruto que está sendo usado em seu código seja explicitamente marcado como tal e que apenas as variáveis que você espera que contenham HTML sejam passadas para `dangerouslySetInnerHTML`. Não é recomendado criar o objeto inline como `
`.
-To see why rendering arbitrary HTML is dangerous, replace the code above with this:
+Para ver por que renderizar HTML arbitrário é perigoso, substitua o código acima por isto:
```js {1-4,7,8}
const post = {
- // Imagine this content is stored in the database.
- content: ` `
+ // Imagine que este conteúdo está armazenado no banco de dados.
+ content: ` `
};
export default function MarkdownPreview() {
- // 🔴 SECURITY HOLE: passing untrusted input to dangerouslySetInnerHTML
+ // 🔴 FURO DE SEGURANÇA: passando uma entrada não confiável para dangerouslySetInnerHTML
const markup = { __html: post.content };
return
;
}
```
-The code embedded in the HTML will run. A hacker could use this security hole to steal user information or to perform actions on their behalf. **Only use `dangerouslySetInnerHTML` with trusted and sanitized data.**
+O código incorporado no HTML será executado. Um hacker poderia usar este furo de segurança para roubar informações do usuário ou realizar ações em seu nome. **Use `dangerouslySetInnerHTML` apenas com dados confiáveis e sanitizados.**
---
-### Handling mouse events {/*handling-mouse-events*/}
+### Manipulando eventos de mouse {/*handling-mouse-events*/}
-This example shows some common [mouse events](#mouseevent-handler) and when they fire.
+Este exemplo mostra alguns [eventos de mouse](#mouseevent-handler) comuns e quando eles são disparados.
@@ -1032,28 +1028,28 @@ This example shows some common [mouse events](#mouseevent-handler) and when they
export default function MouseExample() {
return (
console.log('onMouseEnter (parent)')}
- onMouseLeave={e => console.log('onMouseLeave (parent)')}
+ onMouseEnter={e => console.log('onMouseEnter (pai)')}
+ onMouseLeave={e => console.log('onMouseLeave (pai)')}
>
console.log('onClick (first button)')}
- onMouseDown={e => console.log('onMouseDown (first button)')}
- onMouseEnter={e => console.log('onMouseEnter (first button)')}
- onMouseLeave={e => console.log('onMouseLeave (first button)')}
- onMouseOver={e => console.log('onMouseOver (first button)')}
- onMouseUp={e => console.log('onMouseUp (first button)')}
+ onClick={e => console.log('onClick (primeiro botão)')}
+ onMouseDown={e => console.log('onMouseDown (primeiro botão)')}
+ onMouseEnter={e => console.log('onMouseEnter (primeiro botão)')}
+ onMouseLeave={e => console.log('onMouseLeave (primeiro botão)')}
+ onMouseOver={e => console.log('onMouseOver (primeiro botão)')}
+ onMouseUp={e => console.log('onMouseUp (primeiro botão)')}
>
- First button
+ Primeiro botão
console.log('onClick (second button)')}
- onMouseDown={e => console.log('onMouseDown (second button)')}
- onMouseEnter={e => console.log('onMouseEnter (second button)')}
- onMouseLeave={e => console.log('onMouseLeave (second button)')}
- onMouseOver={e => console.log('onMouseOver (second button)')}
- onMouseUp={e => console.log('onMouseUp (second button)')}
+ onClick={e => console.log('onClick (segundo botão)')}
+ onMouseDown={e => console.log('onMouseDown (segundo botão)')}
+ onMouseEnter={e => console.log('onMouseEnter (segundo botão)')}
+ onMouseLeave={e => console.log('onMouseLeave (segundo botão)')}
+ onMouseOver={e => console.log('onMouseOver (segundo botão)')}
+ onMouseUp={e => console.log('onMouseUp (segundo botão)')}
>
- Second button
+ Segundo botão
);
@@ -1069,9 +1065,9 @@ input { margin-left: 10px; }
---
-### Handling pointer events {/*handling-pointer-events*/}
+### Manipulando eventos de ponteiro {/*handling-pointer-events*/}
-This example shows some common [pointer events](#pointerevent-handler) and when they fire.
+Este exemplo mostra alguns [eventos de ponteiro](#pointerevent-handler) comuns e quando eles são disparados.
@@ -1079,29 +1075,29 @@ This example shows some common [pointer events](#pointerevent-handler) and when
export default function PointerExample() {
return (
console.log('onPointerEnter (parent)')}
- onPointerLeave={e => console.log('onPointerLeave (parent)')}
+ onPointerEnter={e => console.log('onPointerEnter (pai)')}
+ onPointerLeave={e => console.log('onPointerLeave (pai)')}
style={{ padding: 20, backgroundColor: '#ddd' }}
>
console.log('onPointerDown (first child)')}
- onPointerEnter={e => console.log('onPointerEnter (first child)')}
- onPointerLeave={e => console.log('onPointerLeave (first child)')}
- onPointerMove={e => console.log('onPointerMove (first child)')}
- onPointerUp={e => console.log('onPointerUp (first child)')}
+ onPointerDown={e => console.log('onPointerDown (primeiro filho)')}
+ onPointerEnter={e => console.log('onPointerEnter (primeiro filho)')}
+ onPointerLeave={e => console.log('onPointerLeave (primeiro filho)')}
+ onPointerMove={e => console.log('onPointerMove (primeiro filho)')}
+ onPointerUp={e => console.log('onPointerUp (primeiro filho)')}
style={{ padding: 20, backgroundColor: 'lightyellow' }}
>
- First child
+ Primeiro filho
console.log('onPointerDown (second child)')}
- onPointerEnter={e => console.log('onPointerEnter (second child)')}
- onPointerLeave={e => console.log('onPointerLeave (second child)')}
- onPointerMove={e => console.log('onPointerMove (second child)')}
- onPointerUp={e => console.log('onPointerUp (second child)')}
+ onPointerDown={e => console.log('onPointerDown (segundo filho)')}
+ onPointerEnter={e => console.log('onPointerEnter (segundo filho)')}
+ onPointerLeave={e => console.log('onPointerLeave (segundo filho)')}
+ onPointerMove={e => console.log('onPointerMove (segundo filho)')}
+ onPointerUp={e => console.log('onPointerUp (segundo filho)')}
style={{ padding: 20, backgroundColor: 'lightblue' }}
>
- Second child
+ Segundo filho
);
@@ -1117,9 +1113,9 @@ input { margin-left: 10px; }
---
-### Handling focus events {/*handling-focus-events*/}
+### Manipulando eventos de foco {/*handling-focus-events*/}
-In React, [focus events](#focusevent-handler) bubble. You can use the `currentTarget` and `relatedTarget` to differentiate if the focusing or blurring events originated from outside of the parent element. The example shows how to detect focusing a child, focusing the parent element, and how to detect focus entering or leaving the whole subtree.
+No React, [eventos de foco](#focusevent-handler) propagam. Você pode usar o `currentTarget` e `relatedTarget` para diferenciar se os eventos de foco ou desfoque se originaram de fora do elemento pai. O exemplo mostra como detectar o foco de um filho, o foco do elemento pai e como detectar a entrada ou saída do foco de toda a subárvore.
@@ -1130,33 +1126,33 @@ export default function FocusExample() {
tabIndex={1}
onFocus={(e) => {
if (e.currentTarget === e.target) {
- console.log('focused parent');
+ console.log('foco no pai');
} else {
- console.log('focused child', e.target.name);
+ console.log('foco no filho', e.target.name);
}
if (!e.currentTarget.contains(e.relatedTarget)) {
- // Not triggered when swapping focus between children
- console.log('focus entered parent');
+ // Não é acionado ao trocar o foco entre os filhos
+ console.log('foco entrou no pai');
}
}}
onBlur={(e) => {
if (e.currentTarget === e.target) {
- console.log('unfocused parent');
+ console.log('pai sem foco');
} else {
- console.log('unfocused child', e.target.name);
+ console.log('filho sem foco', e.target.name);
}
if (!e.currentTarget.contains(e.relatedTarget)) {
- // Not triggered when swapping focus between children
- console.log('focus left parent');
+ // Não é acionado ao trocar o foco entre os filhos
+ console.log('foco deixou o pai');
}
}}
>
- First name:
+ Primeiro nome:
- Last name:
+ Sobrenome:
@@ -1173,9 +1169,9 @@ input { margin-left: 10px; }
---
-### Handling keyboard events {/*handling-keyboard-events*/}
+### Manipulando eventos de teclado {/*handling-keyboard-events*/}
-This example shows some common [keyboard events](#keyboardevent-handler) and when they fire.
+Este exemplo mostra alguns [eventos de teclado](#keyboardevent-handler) comuns e quando eles são disparados.