Guest User

Untitled

a guest
Jul 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. const renderHTML = (store, renderProps) => {
  2. const components = (
  3. <Provider store={store}> // use redux
  4. <RouterContext {...renderProps} /> // the main app through `renderProps`, matched components with react router
  5. </Provider>
  6. )
  7. const reactHTML = ReactDOM.renderToString(components)
  8.  
  9. return reactHTML
  10. }
  11.  
  12. const app = new Koa()
  13. ... route matching .... (see example above)
Add Comment
Please, Sign In to add comment