├── .gitattributes ├── .gitignore ├── README.md ├── ideas.js ├── package.json └── test.html /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # knockout-react 2 | A wrapper / bridge for using React.js with Knockout and Knockout with React.js 3 | 4 | 5 | ## Usage 6 | 7 | ### Using Knockout from within the context of React 8 | 9 | Using the `KnockoutMixin` mixin for a React component makes that components rendered DOM tree 10 | bound to a viewmodel with `props` and `state` properties, which stay in sync with the 11 | corresponding `props` and `state` of the React component. You simply use the `data-bind` attribute 12 | syntax like you normally would with Knockout. 13 | 14 | ```js 15 | var KnockoutMixin = require('knockout-react').KnockoutMixin; 16 | 17 | var ToDoList = React.createClass({ 18 | mixins: [ KnockoutMixin ], 19 | 20 | propTypes: { 21 | todos: React.PropTypes.array.isRequired 22 | }, 23 | 24 | render() { 25 | return ( 26 |