Más contenido relacionado

Similar a Why you should add React to your Rails application now!(20)

Why you should add React to your Rails application now!

  1. Why you should add React to your Rails application now! David Roberts October 2015 +
  2. What is React? - UI library for Javascript - Declarative API - Reusable Components
  3. var HelloMessage = React.createClass({ render: function() { return <div>Hello {this.props.name}</div>; } }); <HelloMessage name="David" /> Here’s a simple example of a React component
  4. Why React with Rails? - NOT an SPA - Use in anyway you want / unopiniated - Mix with traditional jQuery on the same page - Gem makes it very easy to use with Rails -
  5. https://github.com/reactjs/react-rails React Rails - jsx - babel for es6 -
  6. Install • gem ‘react-rails’ • rails g react:install https://github.com/droberts84/bloccit/commit/ 47ee8cd5587097c6eccdd4de467e11fb02844a2f
  7. Let’s Vote Using Javascript! https://github.com/droberts84/bloccit/commit/ 1cb8298e158dc679a58e72586d5378a09e5762f5
  8. Limitations • Sprockets does not support Modules • Alternatives • Webpack • Browserify • Individual React Components can be re-used - React Rails is great for getting started - Not for SPA like integrations - Not if you need to integrate with lots of other JS toolsets -
  9. Don’t let your current architecture prevent you from moving forward! Source Code: https://github.com/droberts84/bloccit/tree/react