Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/content/warnings/special-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
title: Special Props Warning
---

Most props on a JSX element are passed on to the component, however, there are two special props (`ref` and `key`) which are used by React, and are thus not forwarded to the component.
Большинство пропсов в JSX-элементе передаются в компонент, однако есть два специальных пропса (`ref` и `key`), которые используются React и поэтому не передаются в компонент.

For instance, you can't read `props.key` from a component. If you need to access the same value within the child component, you should pass it as a different prop (ex: `<ListItemWrapper key={result.id} id={result.id} />` and read `props.id`). While this may seem redundant, it's important to separate app logic from hints to React.
Например, вы не можете прочитать `props.key` из компонента. Если вам нужно получить доступ к тому же значению внутри дочернего компонента, вы должны передать его как другой пропс (например: `<ListItemWrapper key={result.id} id={result.id} />` и читать `props.id`). Хотя это может показаться избыточным, важно отделять логику приложения от подсказок для React.
Loading