Hung Phan

Results 7 comments of Hung Phan

I think you can have sth like this // next.config.js ```javascript workboxOpts: { swDest: 'static/service-worker.js', runtimeCaching: [ ``` // main.js ```javascript // offline caching get("/service-worker.js", (req, res) => nextApplication.serveStatic(req, res,...

Did you try to expose that components to the window environment? You can try via `expose-loader` or even use: ``` import Component from 'path/to/component; window.Component = Component; ```

Also the react-rails is for rendering simple components that are in the assets folder. The current build is using webpack, so I suggest to use [hypernova](https://github.com/airbnb/hypernova) instead

Also this will have to follow [this guide](https://github.com/reactjs/react-rails#server-rendering), can you check?

Oh, that part redirects to react route. You need to write a custom handler for that (Same as the wildcard for route). This could be an example for that https://github.com/hung-phan/koa-react-isomorphic/blob/master/app/server/controllers/application.js....

By the way, in the `prerender` method, it will check for the route in react-router. It will throw error if it cannot find that route. It is the current implementation...

Let me try to integrate with the rails server, and post it here. Just keep this one open.