Skip to content

Commit

Permalink
Update content/docs/forwarding-refs.md
Browse files Browse the repository at this point in the history
Co-authored-by: Soroush Torkzadeh <soroush.torkzadeh@gmail.com>
  • Loading branch information
hosseinAMD and sorousht committed Jun 25, 2020
1 parent 1b5ccfd commit 8e78ec1
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion content/docs/forwarding-refs.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ ref فوروارد کردن یک تکنیک برای ارسال خودکار ی
این به این معناست که ref تعیین شده برای `FancyButton`، در اصل به کامپوننت `LogProps` متصل خواهد شد:
`embed:forwarding-refs/fancy-button-ref.js`


خوشبختانه، با استفاده از API های `React.forwardRef`، می توانیم به طور صریح ref ها را به کامپوننت داخلی `FancyButton` فوروارد کنیم. `React.forwardRef` یک تابع رندر که پارامترهای `props` و `ref` را دریافت می‌کند و یک نود ری‌اکت را به عنوان خروجی می‌دهد را می‌پذیرد. برای مثال:
`embed:forwarding-refs/log-props-after.js`

Expand Down

0 comments on commit 8e78ec1

Please sign in to comment.