react-kup
react-kup is a simple, nonintrusive alternative to JSX for coffeescript
- use all coffeescript features naturally when building a react component's virtual-DOM
- tiny single file with just under 100 lines of simple, readable, maintainable code
- huge test suite
passing
with
code coverage
- continuously tested in Node.js (0.12, 4 and 5) and all relevant browsers:
- supports CommonJS, AMD and browser globals
- used in production
- npm package:
npm install react-kup
- bower package:
bower install react-kup
- no additional build step required
- no react mixin
- same concept as kup (kup is an html builder for nodejs) but builds up nested react elements instead of html strings.
- supports all tags supported by react
- changelog
npm install react-kup
bower install react-kup
> var reactKup = ;
lib/react-kup.js supports AMD.
sets the global variable reactKup
when
neither CommonJS nor
AMD are available.
TodoList = ReactcreateClass : -> that = this = reactKup kli itemText reactKup kul thatpropsitemsmap createItem TodoApp = ReactcreateClass : -> items: 'Buy Milk''Buy Sugar' text: 'Add #3' : thissetStatetext: etargetvalue : epreventDefault nextItems = thisstateitemsconcatthisstatetext nextText = '' thissetStateitems: nextItemstext: nextText : -> that = this reactKup kdiv -> kh3 'TODO' kbuild TodoList items: thatstateitems kform onSubmit: thathandleSubmit -> kinput onChange: thatonChange value: thatstatetext kbutton "Add #"
look at the tests for additional examples