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

Nesting React Components with react_component


#1

I was wondering about nesting components with react_component helper. In React I can do this:

<HelloWorld>
     <HelloCanada />
      <HelloUSA />
 </HelloWorld>

It looks like I can only do this with react_component:

<%= react_component("HelloWorld") %> 

which really is an equivalent to

 <HelloWorld />

As a little bit of a background I would like to control the logic for adding children components from a rails controller.

Thank you very much for all the help