

Why I chose ReactJS - giantelk
http://giantelk.wordpress.com/2014/08/27/why-i-chose-reactjs/

======
kellros
Have you checked out MithrilJS
([http://lhorie.github.io/mithril/](http://lhorie.github.io/mithril/))? It's
similar to ReactJS in the sense you can use msx (jsx like templates) to
compile down to JavaScript if you use something like gulp/gulp-
browserify/mithrilify.

Something to keep in mind with ReactJS/MithrilJS is that in a lot of cases you
will need to bring/build your own components, e.g. validation.

MithrilJS brings quite a lot to the table for its small code size (14 KB
minified, 5 KB gzipped), e.g. built in http request (promise compatible),
router, data-binding, IE 6+/mobile compatibility (requires XMLHttpRequest shim
for IE 6, JSON2/3 and EcmaScript 5 shim for <= IE 7, otherwise no dependencies
- see
[http://lhorie.github.io/mithril/tools.html](http://lhorie.github.io/mithril/tools.html))
etc. The documentation is outstanding.

Just a tip if you want to try MithrilJS - a module is essentially an object
that encapsulates the rendering of a component. The controller function
initializes the component and the view renders it. The the controller and view
functions are stateless (think static); the controller function gets called
once to initialize state and the view - 1 or more times - gets passed the
controller/state to (re)render the component. Calling m.module(<dom_element>,
<module>) binds the module to the DOM element/renders the component into that
DOM element.

I think it is pretty neat that you can use ReactJS/MithrilJS for SPA's
(<!DOCTYPE html><script src=".../mithril.min.js"></script><script
src=".../app.js"></script> example) as well as building in page views similar
to what you would have used KnockoutJS for.

~~~
kaonashi
Mithril is way too opinionated about data structures, where every
object/collection needs to be wrapped up.

With React you can use anything, it's the virtual DOM you return it cares
about.

