DEV Community

Discussion on: Add Hot Reload to React Rails 6

Collapse
 
jetsondavis profile image
Jeff Davidson • Edited

Doesn't work?! I get this error in browser and nothing renders:

Warning: Functions are not valid as a React child. This may happen if you return a Component instead of from render. Or maybe you meant to call this function rather than return it.

Collapse
 
nodefiend profile image
chowderhead

Sorry for the late response Jeff!! can you link the code for the component you have between the <React.Fragments>

Collapse
 
bencoopertx profile image
Ben Cooper

All I had to do was switch the import from import { hot } from "react-hot-loader" => import { hot } from "react-hot-loader/root" and it worked for me. Using react-rails 6.