簡體   English   中英

ReactJS與Typescript的雙向綁定

[英]ReactJS two-way binding with Typescript

我正在使用Typescript編寫ReactJS應用程序,我不知道如何指定雙向綁定:

https://facebook.github.io/react/docs/two-way-binding-helpers.html

React.Component類上沒有valueLink可用。 該組件可以實現LinkedStateMixin接口,但我不知道linkState方法的內容應該是什么,以及如何將所有內容連接在一起。

任何人都可以提供一些例子嗎?

值鏈接可用於React.Component類

這是因為React 不支持mixins

要使用LinkedStateMixin你需要使用的mixin createClass ,這是完全unrecommeded在打字稿/ ES6類土地代碼的安全性。

更多

https://facebook.github.io/react/blog/2015/01/27/react-v0.13.0-beta-1.html

在此輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM