Move performance debugging tools to app.jsx
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
import React from "react"
|
||||
import PropTypes from "prop-types"
|
||||
|
||||
let Perf = null
|
||||
let ReactPerfTool = null
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
Perf = require("react-addons-perf")
|
||||
window.Perf = Perf
|
||||
|
||||
ReactPerfTool = require("react-perf-tool")
|
||||
require("react-perf-tool/lib/styles.css")
|
||||
}
|
||||
|
||||
export default class App extends React.Component {
|
||||
|
||||
getLayout() {
|
||||
@@ -14,7 +24,10 @@ export default class App extends React.Component {
|
||||
const Layout = this.getLayout()
|
||||
|
||||
return (
|
||||
<Layout/>
|
||||
<div>
|
||||
<Layout/>
|
||||
<ReactPerfTool perf={Perf} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,6 @@ import ApisPreset from "core/presets/apis"
|
||||
import * as AllPlugins from "core/plugins/all"
|
||||
import { parseSearch } from "core/utils"
|
||||
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
const Perf = require("react-addons-perf")
|
||||
window.Perf = Perf
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
const { GIT_DIRTY, GIT_COMMIT, PACKAGE_VERSION, HOSTNAME, BUILD_TIME } = buildInfo
|
||||
|
||||
|
||||
Reference in New Issue
Block a user