From 4d51a0c72e596f775b2251831a628296c5d545e1 Mon Sep 17 00:00:00 2001 From: Ben Cooling Date: Fri, 15 Jan 2016 21:50:46 +1000 Subject: [PATCH] added react-router 2.0.0-rc4 --- modules/client.js | 6 ++---- modules/server.js | 5 ++--- package.json | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/modules/client.js b/modules/client.js index 7c66ef5..153eb1e 100644 --- a/modules/client.js +++ b/modules/client.js @@ -1,7 +1,6 @@ import React from 'react' -import { match, Router } from 'react-router' +import { match, Router, browserHistory } from 'react-router' import { render } from 'react-dom' -import { createHistory } from 'history' import routes from './routes/RootRoute' const { pathname, search, hash } = window.location @@ -11,8 +10,7 @@ const location = `${pathname}${search}${hash}` // loading route/component code for the initial location match({ routes, location }, () => { render( - , + , document.getElementById('app') ) }) - diff --git a/modules/server.js b/modules/server.js index 88050ec..c9de0e8 100644 --- a/modules/server.js +++ b/modules/server.js @@ -1,7 +1,7 @@ import http from 'http' import React from 'react' import { renderToString } from 'react-dom/server' -import { match, RoutingContext } from 'react-router' +import { match, RouterContext } from 'react-router' import fs from 'fs' import { createPage, write, writeError, writeNotFound, redirect } from './utils/server-utils' import routes from './routes/RootRoute' @@ -9,7 +9,7 @@ import routes from './routes/RootRoute' const PORT = process.env.PORT || 5000 function renderApp(props, res) { - const markup = renderToString() + const markup = renderToString() const html = createPage(markup) write(html, 'text/html', res) } @@ -43,4 +43,3 @@ http.createServer((req, res) => { }).listen(PORT) console.log(`listening on port ${PORT}`) - diff --git a/package.json b/package.json index 8c36b44..28f9725 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "history": "^1.13.1", "react": "^0.14.2", "react-dom": "^0.14.2", - "react-router": "^1.0.0", + "react-router": "^2.0.0-rc4", "webpack": "^1.12.6" }, "scripts": {