Lemoncode / simplechart

Simplechart seed
MIT License
12 stars 13 forks source link

Move seed project from standard react / react router to nextjs allowing serverside rendering #26

Closed brauliodiez closed 6 years ago

brauliodiez commented 6 years ago

Steps:

PedroJesusRomeroOrtega commented 6 years ago

Hello! I'm migrating to Nextjs in this fork.

I have a console.error with React-hot-loader It appears that "react-hot-loader/patch" did not run immediately before the app started While trying to fix this I read that WebPack has it's own HMR, so it's necessary to use ReactHotLoader?

Other question. index.html is necessary? With Nextjs I can´t use ReactDOM.render

const render = (Component) => {
  ReactDOM.render(
    <AppContainer>
      <Component/>
    </AppContainer>,
    document.getElementById('root'),
  );
};

so I replace it with

const index = () => (
  <AppContainer>
    <App />
  </AppContainer>
);
export default index;

I'm not sure how I can do document.getElementById('root')

Thank you.

brauliodiez commented 6 years ago

About react-hot-loader and wepack, since we stick to next, it provides all that we need, if we need to extend it we will need tu use netx.merge

Index.html won't be in use, tha't great

Next provides it's own way to move forward we have to stick with it

Good progress !!