Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions examples/animations/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react/addons'
import React from 'react'
import { render } from 'react-dom'
import ReactCSSTransitionGroup from 'react-addons-transition-group'
import { createHistory, useBasename } from 'history'
import { Router, Route, Link } from 'react-router'

Expand All @@ -8,8 +10,6 @@ const history = useBasename(createHistory)({
basename: '/animations'
})

const { CSSTransitionGroup } = React.addons

class App extends React.Component {
render() {
const { pathname } = this.props.location
Expand All @@ -20,9 +20,9 @@ class App extends React.Component {
<li><Link to="/page1">Page 1</Link></li>
<li><Link to="/page2">Page 2</Link></li>
</ul>
<CSSTransitionGroup component="div" transitionName="example">
<ReactCSSTransitionGroup component="div" transitionName="example">
{React.cloneElement(this.props.children || <div />, { key: pathname })}
</CSSTransitionGroup>
</ReactCSSTransitionGroup>
</div>
)
}
Expand Down Expand Up @@ -50,7 +50,7 @@ class Page2 extends React.Component {
}
}

React.render((
render((
<Router history={history}>
<Route path="/" component={App}>
<Route path="page1" component={Page1} />
Expand Down
5 changes: 3 additions & 2 deletions examples/auth-flow/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { findDOMNode } from 'react'
import React from 'react'
import { render, findDOMNode } from 'react-dom'
import { Router, Route, Link, History } from 'react-router'
import { createHistory, useBasename } from 'history'
import auth from './auth'
Expand Down Expand Up @@ -123,7 +124,7 @@ function requireAuth(nextState, replaceState) {
replaceState({ nextPathname: nextState.location.pathname }, '/login')
}

React.render((
render((
<Router history={history}>
<Route path="/" component={App}>
<Route path="login" component={Login} />
Expand Down
3 changes: 2 additions & 1 deletion examples/dynamic-segments/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { render } from 'react-dom'
import { Router, Route, Link, Redirect } from 'react-router'
import { createHistory, useBasename } from 'history'

Expand Down Expand Up @@ -50,7 +51,7 @@ class Task extends React.Component {
}
}

React.render((
render((
<Router history={history}>
<Route path="/" component={App}>
<Route path="user/:userID" component={User}>
Expand Down
3 changes: 2 additions & 1 deletion examples/huge-apps/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*eslint-disable no-unused-vars */
import React from 'react'
import { render } from 'react-dom'
import { createHistory, useBasename } from 'history'
import { Router } from 'react-router'
import stubbedCourses from './stubs/COURSES'
Expand All @@ -23,7 +24,7 @@ const rootRoute = {
} ]
}

React.render(
render(
<Router history={history} routes={rootRoute} />,
document.getElementById('example')
)
Expand Down
5 changes: 3 additions & 2 deletions examples/master-detail/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { findDOMNode } from 'react'
import React from 'react'
import { render, findDOMNode } from 'react-dom'
import { createHistory, useBasename } from 'history'
import { Router, History, Route, IndexRoute, Link } from 'react-router'
import ContactStore from './ContactStore'
Expand Down Expand Up @@ -155,7 +156,7 @@ var NotFound = React.createClass({
}
})

React.render((
render((
<Router history={history}>
<Route path="/" component={App}>
<IndexRoute component={Index} />
Expand Down
20 changes: 10 additions & 10 deletions examples/nested-animations/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import React from 'react/addons'
import React from 'react'
import { render } from 'react-dom'
import ReactCSSTransitionGroup from 'react-addons-transition-group'
import { createHistory, useBasename } from 'history'
import { Router, Route, Link } from 'react-router'

Expand All @@ -8,8 +10,6 @@ const history = useBasename(createHistory)({
basename: '/nested-animations'
})

const { CSSTransitionGroup } = React.addons

class App extends React.Component {
render() {
const { pathname } = this.props.location
Expand All @@ -23,9 +23,9 @@ class App extends React.Component {
<li><Link to="/page1">Page 1</Link></li>
<li><Link to="/page2">Page 2</Link></li>
</ul>
<CSSTransitionGroup component="div" transitionName="swap">
<ReactCSSTransitionGroup component="div" transitionName="swap">
{React.cloneElement(this.props.children || <div />, { key: key })}
</CSSTransitionGroup>
</ReactCSSTransitionGroup>
</div>
)
}
Expand All @@ -42,9 +42,9 @@ class Page1 extends React.Component {
<li><Link to="/page1/tab1">Tab 1</Link></li>
<li><Link to="/page1/tab2">Tab 2</Link></li>
</ul>
<CSSTransitionGroup component="div" transitionName="example">
<ReactCSSTransitionGroup component="div" transitionName="example">
{React.cloneElement(this.props.children || <div/>, { key: pathname })}
</CSSTransitionGroup>
</ReactCSSTransitionGroup>
</div>
)
}
Expand All @@ -61,9 +61,9 @@ class Page2 extends React.Component {
<li><Link to="/page2/tab1">Tab 1</Link></li>
<li><Link to="/page2/tab2">Tab 2</Link></li>
</ul>
<CSSTransitionGroup component="div" transitionName="example">
<ReactCSSTransitionGroup component="div" transitionName="example">
{React.cloneElement(this.props.children || <div/>, { key: pathname })}
</CSSTransitionGroup>
</ReactCSSTransitionGroup>
</div>
)
}
Expand Down Expand Up @@ -91,7 +91,7 @@ class Tab2 extends React.Component {
}
}

React.render((
render((
<Router history={history}>
<Route path="/" component={App}>
<Route path="page1" component={Page1}>
Expand Down
3 changes: 2 additions & 1 deletion examples/passing-props-to-children/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { render } from 'react-dom'
import { createHistory, useBasename } from 'history'
import { Router, Route, Link, History } from 'react-router'

Expand Down Expand Up @@ -78,7 +79,7 @@ const Taco = React.createClass({
}
})

React.render((
render((
<Router history={history}>
<Route path="/" component={App}>
<Route path="taco/:name" component={Taco} />
Expand Down
3 changes: 2 additions & 1 deletion examples/pinterest/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { render } from 'react-dom'
import { createHistory, useBasename } from 'history'
import { Router, Route, IndexRoute, Link } from 'react-router'

Expand Down Expand Up @@ -139,7 +140,7 @@ const Picture = React.createClass({
}
})

React.render((
render((
<Router history={history}>
<Route path="/" component={App}>
<IndexRoute component={Index}/>
Expand Down
3 changes: 2 additions & 1 deletion examples/query-params/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { render } from 'react-dom'
import { createHistory, useBasename } from 'history'
import { Router, Route, Link } from 'react-router'

Expand Down Expand Up @@ -36,7 +37,7 @@ class App extends React.Component {
}
}

React.render((
render((
<Router history={history}>
<Route path="/" component={App}>
<Route path="user/:userID" component={User} />
Expand Down
3 changes: 2 additions & 1 deletion examples/shared-root/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { render } from 'react-dom'
import { createHistory, useBasename } from 'history'
import { Router, Route, Link } from 'react-router'

Expand Down Expand Up @@ -73,7 +74,7 @@ class ForgotPassword extends React.Component {
}
}

React.render((
render((
<Router history={history}>
<Route path="/" component={App}>
<Route component={SignedOut}>
Expand Down
3 changes: 2 additions & 1 deletion examples/sidebar/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { render } from 'react-dom'
import { createHistory, useBasename } from 'history'
import { Router, Route, Link } from 'react-router'
import data from './data'
Expand Down Expand Up @@ -106,7 +107,7 @@ class App extends React.Component {
}
}

React.render((
render((
<Router history={history}>
<Route path="/" component={App}>
<Route path="category/:category" components={{ content: Category, sidebar: CategorySidebar }}>
Expand Down
3 changes: 2 additions & 1 deletion examples/transitions/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { render } from 'react-dom'
import { createHistory, useBasename } from 'history'
import { Router, Route, Link, History, Lifecycle } from 'react-router'

Expand Down Expand Up @@ -69,7 +70,7 @@ const Form = React.createClass({
}
})

React.render((
render((
<Router history={history}>
<Route path="/" component={App}>
<Route path="dashboard" component={Dashboard} />
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"qs": "^4.0.0",
"react": "0.14.0",
"react-addons-test-utils": "0.14.0",
"react-addons-transition-group": "0.14.0",
"react-dom": "0.14.0",
"rf-changelog": "^0.4.0",
"style-loader": "^0.12.4",
Expand Down