Skip to content

Commit

Permalink
Merge pull request #141 from mohshbool/warnings/special-props
Browse files Browse the repository at this point in the history
[Done] translated warnings/special-props
  • Loading branch information
Fcmam5 committed Jul 21, 2019
2 parents 955d305 + 86ed33a commit 3f93c05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions content/warnings/special-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ layout: single
permalink: warnings/special-props.html
---

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, attempting to access `this.props.key` from a component (i.e., the render function or [propTypes](/docs/typechecking-with-proptypes.html#proptypes)) is not defined. 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} />`). While this may seem redundant, it's important to separate app logic from reconciling hints.
ุนู„ู‰ ุณุจูŠู„ ุงู„ู…ุซุงู„ุŒ ู…ูุญุงูˆู„ุฉ ุงู„ูˆุตูˆู„ ุฅู„ู‰ `this.props.key` ู…ู† ู…ููƒูˆู‘ู† (ุฃูŠ ู…ู† ุฏุงู„ู‘ุฉ ุงู„ุชุตูŠูŠุฑ ุฃูˆ [ุฃู†ูˆุงุน ุงู„ุฎูˆุงุต "propTypes"](/docs/typechecking-with-proptypes.html#proptypes)) ุบูŠุฑ ู…ูุนุฑู‘ูุฉ. ุฅู† ูƒูู†ุช ุจุญุงุฌุฉ ู„ู„ูˆุตูˆู„ ุฅู„ู‰ ู†ูุณ ุงู„ู‚ูŠู…ุฉ ุฏุงุฎู„ ุงู„ู…ููƒูˆู‘ู† ุงู„ุฅุจู† ูุนู„ูŠูƒ ุจุชู…ุฑูŠุฑู‡ุง ูƒุฎุงุตูŠุฉ ุฃูุฎุฑู‰ (ู…ุซู„: `<ListItemWrapper key={result.id} id={result.id} />`). ุจูŠู†ู…ุง ู…ู† ุงู„ู…ูู…ูƒู† ุฃู† ูŠุจุฏูˆ ุฒุงุฆุฏ ุนู…ุง ูŠู†ุจุบูŠ ุจู„ ุฃู†ู‡ ู…ู† ุงู„ู…ูู‡ู… ูุตู„ ู…ู†ุทู‚ูŠุฉ ุงู„ุชุทุจูŠู‚ ุนู† ุชู„ู…ูŠุญุงุช ุงู„ู…ูุตุงู„ุญุฉ "reconciling hints".

0 comments on commit 3f93c05

Please sign in to comment.