Slide 1

Slide 1 text

Taming jQuery Selectors with React Sean Carpenter @scarpenter [email protected]

Slide 2

Slide 2 text

What’s wrong with jQuery? • Nothing! • But it can get a little repetitive • $(“.slider.main”).show();
 $(“.slider.main”).text(“Hi there!”);
 $(“.slider.main”).hide();

Slide 3

Slide 3 text

Lots of Options • Application frameworks • Angular • Ember • MV(C|VM) • Backbone • Knockout

Slide 4

Slide 4 text

React • Facebook and Instagram open source project • Just concerned with the “V” in MVC • Declarative UI construction • Can be added piece by piece to an existing application

Slide 5

Slide 5 text

Simple React Sample https://github.com/scarpenter/cposc-2014

Slide 6

Slide 6 text

Notes About the Sample • No jQuery used, but it could have been • It’s easy (easier?) to use React on one page or part of a page • React plays well with other libraries

Slide 7

Slide 7 text

React Resources http://facebook.github.io/react/ • Lots of good documentation • A great intro tutorial • Blog with announcements and tips

Slide 8

Slide 8 text

Everything Else • react-rails gem for using React easily with Rails • Relatively easy to use React from Coffescript • Use React without JSX: React.DOM.div • With JSX, using backticks to treat JSX as JS • react-tools npm package to transform JSX to JS

Slide 9

Slide 9 text

Questions?