It's proving surprisingly difficult to following the installation guide for Webpacker and ultimately get that line from application.js to log:
console.log('Hello World from Webpacker')
Or, to see hello_react.jsx on the screen.
Could you guys add a reference to an example app that accomplishes this simple goal?
There's a great article by @gauravtiwari.
You can also checkout my Github repo, this is probably the fastest way to get started.
Awesome! Add to official README?
My biggest hang-up was trying to figure out how to pass props from a controller or a .html view to a React component. javascript_pack_tag doesn't seem to do the job. I finally settled on the webpacker-react gem as the only way to do it.
Is there an official blessed path for that?
@mandysimon88 This part is dependent on community integrations. We will document this in README. Both webpacker-react and react-rails provides first class support for webpacker - https://github.com/reactjs/react-rails#use-with-webpacker (react-rails is on more mature side with support for server side rendering etc.)
Most helpful comment
Awesome! Add to official README?
My biggest hang-up was trying to figure out how to pass props from a controller or a .html view to a React component.
javascript_pack_tagdoesn't seem to do the job. I finally settled on thewebpacker-reactgem as the only way to do it.Is there an official blessed path for that?