You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My app crashes with react-rails, so I've included the stack trace and the exact steps which make it crash.
My app doesn't crash, but I'm getting unexpected behavior. So, I've described the unexpected behavior and suggested a new behavior.
I'm trying to use react-rails with another library, but I'm having trouble. I've described my JavaScript management setup (eg, Sprockets, Webpack...), how I'm trying to use this other library, and why it's not working.
I have another issue to discuss.
I'm using react-rails with webpacker. My javascripts directory looks like this:
I'm just a little confused about how my packs should look like. Right now I have just one "packs/application.js", which has the code that sets the context for react-rails. I'm calling <%= javascript_pack_tag 'application' %> inside application.html.erb and everything works fine.
But does this mean that every thing under javascript/components gets included for every view?
Should there be a separate pack for each view?
And if that's the case, how do I handle the components that are shared between views (under components/shared)
Thanks
The text was updated successfully, but these errors were encountered:
I will probably add a small how-to and an example to the react-example-app repo of code splitting.
There are quite a few articles on the subject and although I don't have an example of it interacting with this gem, I'm confident that it should work as we are just using Webpacker directly, the only problem that could happen is if the gem gets upset about the webpacker context serverside, in which case I'd consider that a bug.
Let me know how you get on! If it works then I'd love to see an example, if not then a bug report would help others trying to do this 😄 Good luck! And happy new year :)
Thanks a lot @BookOfGreg
I'll make sure to take a look at the articles you linked.
I also found a similar issue.
Will report back if I made any progress. I just need to decide if I really need code chunking or not.
Thanks for the help! And happy new year to you too.
Help us help you! Please choose one:
I'm using react-rails with webpacker. My javascripts directory looks like this:
I'm just a little confused about how my packs should look like. Right now I have just one "packs/application.js", which has the code that sets the context for react-rails. I'm calling
<%= javascript_pack_tag 'application' %>
inside application.html.erb and everything works fine.But does this mean that every thing under
javascript/components
gets included for every view?Should there be a separate pack for each view?
And if that's the case, how do I handle the components that are shared between views (under
components/shared
)Thanks
The text was updated successfully, but these errors were encountered: