From 4f873b00943626ea30a3d801b522129c780d97bf Mon Sep 17 00:00:00 2001 From: Jonny Buchanan Date: Sat, 31 Oct 2015 09:27:32 +0000 Subject: [PATCH] Add an "Importing" section to the upgrade guide --- UPGRADE_GUIDE.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/UPGRADE_GUIDE.md b/UPGRADE_GUIDE.md index 7ed03745d6..b9c7939104 100644 --- a/UPGRADE_GUIDE.md +++ b/UPGRADE_GUIDE.md @@ -16,6 +16,24 @@ integration with libs like redux and relay, and lots more. But for now, here's how to translate the old API to the new one. +### Importing + +The new `Router` component is a property of the top-level module. + +```js +// v0.13.x +var Router = require('react-router'); +var Route = Router.Route; + +// v1.0 +var ReactRouter = require('react-router'); +var Router = ReactRouter.Router; +var Route = ReactRouter.Route; + +// or using object destructuring +var { Router, Route } = require('react-router'); +``` + ### Rendering ```js