Skip to content

Commit d4aa590

Browse files
committed
Merge pull request #2191 from rackt/update-examples
update examples for react 0.14.0
2 parents 33063ed + d87b211 commit d4aa590

File tree

13 files changed

+39
-28
lines changed

13 files changed

+39
-28
lines changed

examples/animations/app.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import React from 'react/addons'
1+
import React from 'react'
2+
import { render } from 'react-dom'
3+
import ReactCSSTransitionGroup from 'react-addons-transition-group'
24
import { createHistory, useBasename } from 'history'
35
import { Router, Route, Link } from 'react-router'
46

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

11-
const { CSSTransitionGroup } = React.addons
12-
1313
class App extends React.Component {
1414
render() {
1515
const { pathname } = this.props.location
@@ -20,9 +20,9 @@ class App extends React.Component {
2020
<li><Link to="/page1">Page 1</Link></li>
2121
<li><Link to="/page2">Page 2</Link></li>
2222
</ul>
23-
<CSSTransitionGroup component="div" transitionName="example">
23+
<ReactCSSTransitionGroup component="div" transitionName="example">
2424
{React.cloneElement(this.props.children || <div />, { key: pathname })}
25-
</CSSTransitionGroup>
25+
</ReactCSSTransitionGroup>
2626
</div>
2727
)
2828
}
@@ -50,7 +50,7 @@ class Page2 extends React.Component {
5050
}
5151
}
5252

53-
React.render((
53+
render((
5454
<Router history={history}>
5555
<Route path="/" component={App}>
5656
<Route path="page1" component={Page1} />

examples/auth-flow/app.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { findDOMNode } from 'react'
1+
import React from 'react'
2+
import { render, findDOMNode } from 'react-dom'
23
import { Router, Route, Link, History } from 'react-router'
34
import { createHistory, useBasename } from 'history'
45
import auth from './auth'
@@ -123,7 +124,7 @@ function requireAuth(nextState, replaceState) {
123124
replaceState({ nextPathname: nextState.location.pathname }, '/login')
124125
}
125126

126-
React.render((
127+
render((
127128
<Router history={history}>
128129
<Route path="/" component={App}>
129130
<Route path="login" component={Login} />

examples/dynamic-segments/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import { render } from 'react-dom'
23
import { Router, Route, Link, Redirect } from 'react-router'
34
import { createHistory, useBasename } from 'history'
45

@@ -50,7 +51,7 @@ class Task extends React.Component {
5051
}
5152
}
5253

53-
React.render((
54+
render((
5455
<Router history={history}>
5556
<Route path="/" component={App}>
5657
<Route path="user/:userID" component={User}>

examples/huge-apps/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*eslint-disable no-unused-vars */
22
import React from 'react'
3+
import { render } from 'react-dom'
34
import { createHistory, useBasename } from 'history'
45
import { Router } from 'react-router'
56
import stubbedCourses from './stubs/COURSES'
@@ -23,7 +24,7 @@ const rootRoute = {
2324
} ]
2425
}
2526

26-
React.render(
27+
render(
2728
<Router history={history} routes={rootRoute} />,
2829
document.getElementById('example')
2930
)

examples/master-detail/app.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { findDOMNode } from 'react'
1+
import React from 'react'
2+
import { render, findDOMNode } from 'react-dom'
23
import { createHistory, useBasename } from 'history'
34
import { Router, History, Route, IndexRoute, Link } from 'react-router'
45
import ContactStore from './ContactStore'
@@ -155,7 +156,7 @@ var NotFound = React.createClass({
155156
}
156157
})
157158

158-
React.render((
159+
render((
159160
<Router history={history}>
160161
<Route path="/" component={App}>
161162
<IndexRoute component={Index} />

examples/nested-animations/app.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import React from 'react/addons'
1+
import React from 'react'
2+
import { render } from 'react-dom'
3+
import ReactCSSTransitionGroup from 'react-addons-transition-group'
24
import { createHistory, useBasename } from 'history'
35
import { Router, Route, Link } from 'react-router'
46

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

11-
const { CSSTransitionGroup } = React.addons
12-
1313
class App extends React.Component {
1414
render() {
1515
const { pathname } = this.props.location
@@ -23,9 +23,9 @@ class App extends React.Component {
2323
<li><Link to="/page1">Page 1</Link></li>
2424
<li><Link to="/page2">Page 2</Link></li>
2525
</ul>
26-
<CSSTransitionGroup component="div" transitionName="swap">
26+
<ReactCSSTransitionGroup component="div" transitionName="swap">
2727
{React.cloneElement(this.props.children || <div />, { key: key })}
28-
</CSSTransitionGroup>
28+
</ReactCSSTransitionGroup>
2929
</div>
3030
)
3131
}
@@ -42,9 +42,9 @@ class Page1 extends React.Component {
4242
<li><Link to="/page1/tab1">Tab 1</Link></li>
4343
<li><Link to="/page1/tab2">Tab 2</Link></li>
4444
</ul>
45-
<CSSTransitionGroup component="div" transitionName="example">
45+
<ReactCSSTransitionGroup component="div" transitionName="example">
4646
{React.cloneElement(this.props.children || <div/>, { key: pathname })}
47-
</CSSTransitionGroup>
47+
</ReactCSSTransitionGroup>
4848
</div>
4949
)
5050
}
@@ -61,9 +61,9 @@ class Page2 extends React.Component {
6161
<li><Link to="/page2/tab1">Tab 1</Link></li>
6262
<li><Link to="/page2/tab2">Tab 2</Link></li>
6363
</ul>
64-
<CSSTransitionGroup component="div" transitionName="example">
64+
<ReactCSSTransitionGroup component="div" transitionName="example">
6565
{React.cloneElement(this.props.children || <div/>, { key: pathname })}
66-
</CSSTransitionGroup>
66+
</ReactCSSTransitionGroup>
6767
</div>
6868
)
6969
}
@@ -91,7 +91,7 @@ class Tab2 extends React.Component {
9191
}
9292
}
9393

94-
React.render((
94+
render((
9595
<Router history={history}>
9696
<Route path="/" component={App}>
9797
<Route path="page1" component={Page1}>

examples/passing-props-to-children/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import { render } from 'react-dom'
23
import { createHistory, useBasename } from 'history'
34
import { Router, Route, Link, History } from 'react-router'
45

@@ -78,7 +79,7 @@ const Taco = React.createClass({
7879
}
7980
})
8081

81-
React.render((
82+
render((
8283
<Router history={history}>
8384
<Route path="/" component={App}>
8485
<Route path="taco/:name" component={Taco} />

examples/pinterest/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import { render } from 'react-dom'
23
import { createHistory, useBasename } from 'history'
34
import { Router, Route, IndexRoute, Link } from 'react-router'
45

@@ -139,7 +140,7 @@ const Picture = React.createClass({
139140
}
140141
})
141142

142-
React.render((
143+
render((
143144
<Router history={history}>
144145
<Route path="/" component={App}>
145146
<IndexRoute component={Index}/>

examples/query-params/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import { render } from 'react-dom'
23
import { createHistory, useBasename } from 'history'
34
import { Router, Route, Link } from 'react-router'
45

@@ -36,7 +37,7 @@ class App extends React.Component {
3637
}
3738
}
3839

39-
React.render((
40+
render((
4041
<Router history={history}>
4142
<Route path="/" component={App}>
4243
<Route path="user/:userID" component={User} />

examples/shared-root/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import { render } from 'react-dom'
23
import { createHistory, useBasename } from 'history'
34
import { Router, Route, Link } from 'react-router'
45

@@ -73,7 +74,7 @@ class ForgotPassword extends React.Component {
7374
}
7475
}
7576

76-
React.render((
77+
render((
7778
<Router history={history}>
7879
<Route path="/" component={App}>
7980
<Route component={SignedOut}>

0 commit comments

Comments
 (0)