-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[reactV14] fix the home screen of the docs
- Loading branch information
1 parent
e83479d
commit 3654106
Showing
4 changed files
with
113 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,22 @@ | ||
(function () { | ||
const React = require('react'); | ||
const ReactDOM = require('react-dom'); | ||
const {Router} = require('react-router'); | ||
const AppRoutes = require('./app-routes.jsx'); | ||
const injectTapEventPlugin = require("react-tap-event-plugin"); | ||
|
||
let React = require('react'), | ||
Router = require('react-router'), | ||
AppRoutes = require('./app-routes.jsx'), | ||
injectTapEventPlugin = require("react-tap-event-plugin"); | ||
//Needed for React Developer Tools | ||
window.React = React; | ||
|
||
//Needed for React Developer Tools | ||
window.React = React; | ||
//Needed for onTouchTap | ||
//Can go away when react 1.0 release | ||
//Check this repo: | ||
//https://github.com/zilverline/react-tap-event-plugin | ||
injectTapEventPlugin(); | ||
|
||
//Needed for onTouchTap | ||
//Can go away when react 1.0 release | ||
//Check this repo: | ||
//https://github.com/zilverline/react-tap-event-plugin | ||
injectTapEventPlugin(); | ||
|
||
/** Render the main app component. You can read more about the react-router here: | ||
* https://github.com/rackt/react-router/blob/master/docs/guides/overview.md | ||
*/ | ||
Router | ||
// Runs the router, similiar to the Router.run method. You can think of it as an | ||
// initializer/constructor method. | ||
.create({ | ||
routes: AppRoutes, | ||
scrollBehavior: Router.ScrollToTopBehavior | ||
}) | ||
// This is our callback function, whenever the url changes it will be called again. | ||
// Handler: The ReactComponent class that will be rendered | ||
.run(function (Handler) { | ||
React.render(<Handler/>, document.getElementById('app')); | ||
}); | ||
|
||
})(); | ||
/** | ||
* Render the main app component. You can read more about the react-router here: | ||
* https://github.com/rackt/react-router/blob/master/docs/guides/overview.md | ||
*/ | ||
ReactDOM.render(<Router> | ||
{AppRoutes} | ||
</Router>, document.getElementById('app')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters