350 open graph react #360

Merged
bones7242 merged 30 commits from 350-open-graph-react into master 2018-02-24 17:55:00 +01:00
4 changed files with 8 additions and 7 deletions
Showing only changes of commit 224d057b9a - Show all commits

View file

@ -1,11 +1,12 @@
import React from 'react';
import { renderToString } from 'react-dom/server';
import { createStore } from 'redux';
import Reducer from '../react/reducers';
import renderFullPage from './renderFullPage.js';
import { Provider } from 'react-redux';
import StaticRouter from 'react-router-dom/StaticRouter';
import GAListener from '../react/components/GAListener';
import App from '../react/app';
import renderFullPage from './renderFullPage.js';
module.exports = (req, res) => {
let context = {};

View file

@ -14,7 +14,7 @@ module.exports = (html, preloadedState) => {
<script>
window.__PRELOADED_STATE__ = ${JSON.stringify(preloadedState).replace(/</g, '\\\u003c')}
</script>
<script src="/static/bundle.js"></script>
<script src="/bundle/bundle.js"></script>
</body>
</html>
`;

View file

@ -1,5 +1,5 @@
neb-b commented 2018-02-23 20:57:29 +01:00 (Migrated from github.com)
Review

Probably don't need these console.logs here.

Probably don't need these `console.log`s here.
neb-b commented 2018-02-23 20:57:29 +01:00 (Migrated from github.com)
Review

Probably don't need these console.logs here.

Probably don't need these `console.log`s here.
import React from 'react';
import { render } from 'react-dom';
neb-b commented 2018-02-23 20:57:29 +01:00 (Migrated from github.com)
Review

Probably don't need these console.logs here.

Probably don't need these `console.log`s here.
import { hydrate } from 'react-dom';
neb-b commented 2018-02-23 20:57:29 +01:00 (Migrated from github.com)
Review

Probably don't need these console.logs here.

Probably don't need these `console.log`s here.
import { Provider } from 'react-redux';
import { createStore, applyMiddleware, compose } from 'redux';
import { BrowserRouter } from 'react-router-dom';
@ -35,7 +35,7 @@ if (preloadedState) {
neb-b commented 2018-02-23 20:57:29 +01:00 (Migrated from github.com)
Review

Probably don't need these console.logs here.

Probably don't need these `console.log`s here.
neb-b commented 2018-02-23 20:57:29 +01:00 (Migrated from github.com)
Review

Probably don't need these console.logs here.

Probably don't need these `console.log`s here.
sagaMiddleware.run(rootSaga);
// render the app
render(
neb-b commented 2018-02-23 20:57:29 +01:00 (Migrated from github.com)
Review

Probably don't need these console.logs here.

Probably don't need these `console.log`s here.
hydrate(
neb-b commented 2018-02-23 20:57:29 +01:00 (Migrated from github.com)
Review

Probably don't need these console.logs here.

Probably don't need these `console.log`s here.
<Provider store={store}>
<BrowserRouter>
<GAListener>

neb-b commented 2018-02-23 20:57:29 +01:00 (Migrated from github.com)
Review

Probably don't need these console.logs here.

Probably don't need these `console.log`s here.
neb-b commented 2018-02-23 20:57:29 +01:00 (Migrated from github.com)
Review

Probably don't need these console.logs here.

Probably don't need these `console.log`s here.

View file

@ -1,10 +1,10 @@
const { site } = require('../config/speechConfig.js');
// const handleRender = require('../helpers/handleRender.jsx');
const handleRender = require('../helpers/handleRender.jsx');
module.exports = (app) => {
// route for the home page
app.get('/', (req, res) => {
res.status(200).render('index');
handleRender(req, res);
});
// route to display login page
app.get('/login', (req, res) => {