diff --git a/Gruntfile.js b/Gruntfile.js
index 9f8e622e48..bcce4c838f 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -136,7 +136,8 @@ module.exports = function (grunt) {
almond: "../tools/vendor/almond"
},
packages: [
- { name: 'react', location: '../node_modules/react', main: './react' }
+ { name: 'react', location: '../node_modules/react', main: './react' },
+ { name: 'classnames', location: '../node_modules/classnames', main: './index' }
],
include: ["almond", "react-bootstrap"],
exclude: ["react"],
diff --git a/docs/build.js b/docs/build.js
index 4252a7c420..dbde01a273 100755
--- a/docs/build.js
+++ b/docs/build.js
@@ -2,12 +2,22 @@
var fs = require('fs');
var path = require('path');
-var nodejsx = require('node-jsx').install();
+
+require('node-jsx').install();
+
+var React = require('react');
+var routes = require('./src/Routes');
+var Router = require('react-router');
+
var Root = require('./src/Root');
Root.getPages()
.forEach(function (fileName) {
- var RootHTML = Root.renderToString({initialPath: fileName});
- fs.writeFileSync(path.join(__dirname, fileName), RootHTML);
+ Router.run(routes, '/' + fileName, function (Handler) {
+ var RootHTML = React.renderToString(React.createElement(Handler));
+
+ fs.writeFileSync(
+ path.join(__dirname, fileName), RootHTML);
+ })
});
\ No newline at end of file
diff --git a/docs/client.js b/docs/client.js
index 80ebcd9b4e..733668d326 100644
--- a/docs/client.js
+++ b/docs/client.js
@@ -1,9 +1,15 @@
'use strict';
var React = require('react');
-var Root = require('./src/Root');
+var Router = require('react-router');
+var routes = require('./src/Routes');
// For React devtools
window.React = React;
-React.render(React.createFactory(Root)(window.INITIAL_PROPS), document);
+Router.run(routes, Router.RefreshLocation, function (Handler) {
+ React.render(
+ React.createElement(Handler, window.INITIAL_PROPS), document);
+})
+
+
diff --git a/docs/server.js b/docs/server.js
index 0b55c78101..244e93d0fb 100644
--- a/docs/server.js
+++ b/docs/server.js
@@ -2,15 +2,19 @@
var express = require('express');
+
var development = process.env.NODE_ENV !== 'production';
var app = express();
if (development) {
+ var React = require('react');
var path = require('path');
var url = require('url');
var browserify = require('connect-browserify');
var nodejsx = require('node-jsx').install();
- var Root = require('./src/Root');
+
+ var routes = require('./src/Routes');
+ var Router = require('react-router');
app = app
.get('/assets/bundle.js', browserify('./client', {debug: true, watch: false}))
@@ -18,9 +22,14 @@ if (development) {
.use('/vendor', express.static(path.join(__dirname, 'vendor')))
.use(function renderApp(req, res) {
var fileName = url.parse(req.url).pathname;
- var RootHTML = Root.renderToString({initialPath: fileName});
- res.send(RootHTML);
+ Router.run(routes, req.url, function (Handler) {
+ var RootHTML = React.renderToString(React.createElement(Handler));
+
+ res.send(RootHTML);
+ })
+
+
});
} else {
app = app
diff --git a/docs/src/NavMain.js b/docs/src/NavMain.js
index 72cb59f400..930064273d 100644
--- a/docs/src/NavMain.js
+++ b/docs/src/NavMain.js
@@ -1,19 +1,20 @@
'use strict';
var React = require('react');
-var Router = require('react-router-component');
+var Router = require('react-router');
var Navbar = require('../../lib/Navbar');
var Nav = require('../../lib/Nav');
+
var InternalLink = Router.Link;
var NAV_LINKS = {
'getting-started': {
- link: '/getting-started.html',
+ link: 'getting-started',
title: 'Getting started'
},
'components': {
- link: '/components.html',
+ link: 'components',
title: 'Components'
}
};
@@ -24,7 +25,7 @@ var NavMain = React.createClass({
},
render: function () {
- var brand =