Re:Modern Front-end in Rails
by meesterdude on Friday December 08, 2017 @11:49AM
(#15880006)
> sprinkled with react
I can sprinkle in javascript for a normal rails app to add behavior - but i thought react required moving all rendering into it? are you able to "sprinkle" with react within otherwise normal html/css/js?
Yes you can. Not like jQuery where you use it to manipulate the DOM (as rendered from HTML generated on the server).
With React you basically let it manage one or more subtrees of the DOM; you let React do the rendering for that subtree at all times (possibly using React on the server to do pre-rendering).
Re:Modern Front-end in Rails
by jemminger2 on Sunday December 10, 2017 @11:20AM
(#15892044)
It's even easier to sprinkle with Vue.js
Not every part of an app needs the duplicity of state, or need to look dynamic.