ShakaCode | ShakaCode Blog | Rails On Maui Blog | Rails | ReactJs | JavaScript | Webpack | Productivity |

Using Regexp to update to ReactOnRails v3

v3.0.0 is ready!

You will want to convert to the new syntax for react_component. Regexp replacement makes this super easy:

You want to search for:

(react_component\("\w+", )

and replace with

$1props:

Note, no space between the $1 and props, and a space after the colon.

Here’s some screen grabs of how you do the search and replace using RubyMine: