React On Rails Tutorial Series, Part 3, Code Walkthrough, v7

preview_player
Показать описание
Note: v8 has slight changes due to Webpacker Support.

React on Rails is the number one open source integration of React + Webpack + Ruby on Rails.

Рекомендации по теме
Комментарии
Автор

Thanks for sharing Justin, it works good in my case.

damonwu
Автор

Love the video, you are a great explainer (and your pronunciation of com-ponent is adorable haha!)

aloufin
Автор

Thank you for walking through the code structure.

nitinafitness
Автор

If anyone came here after upgrading their existing rails app to support react, you may not find similar directory structure in you app.

nitinafitness
Автор

Works great! Though I am running into an issue, my top level component is a functional component but I get an error rendering it if I true to use hooks. Does the top level component always have to be class based? It works with class based but not functional

codecodeohh
Автор

I also don't have the app/assets/webpack directory

jendiamond
Автор

This was also not in the

# Add folder with generated assets to assets.paths
<< Rails.root.join("app", "assets", "webpack")

Do I just add that in also?

jendiamond
Автор

Do you need to change this?


```
output: {
// Name comes from the entry section.
filename: '[name]-[hash].js',

// Leading slash is necessary
publicPath: `/${webpackPublicOutputDir}`,
path: webpackOutputPath,
},
```

to:
```
output: {
filename: 'webpack-bundle.js,
path: '../app/assets/webpack',
}
```

Or is that the same thing?

jendiamond
visit shbcf.ru