Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ErrorDebug component on error of react-hot-loader #852

Merged
merged 2 commits into from
Jan 21, 2017
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
4 changes: 2 additions & 2 deletions lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class App extends Component {

return <div>
<Container {...containerProps} />
{ErrorDebug && err ? <ErrorDebug err={err} /> : null}
{ErrorDebug && err ? <ErrorDebug error={err} /> : null}
</div>
}

Expand All @@ -40,7 +40,7 @@ class Container extends Component {

// includes AppContainer which bypasses shouldComponentUpdate method
// https://github.com/gaearon/react-hot-loader/issues/442
return <AppContainer>
return <AppContainer errorReporter={ErrorDebug}>
<Component {...props} url={url} />
</AppContainer>
}
Expand Down
4 changes: 2 additions & 2 deletions lib/error-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import ansiHTML from 'ansi-html'
import Head from './head'

export default ({ err, err: { name, message, module } }) => (
export default ({ error, error: { name, message, module } }) => (
<div style={styles.errorDebug}>
<Head>
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
Expand All @@ -11,7 +11,7 @@ export default ({ err, err: { name, message, module } }) => (
{
name === 'ModuleBuildError'
? <pre style={styles.message} dangerouslySetInnerHTML={{ __html: ansiHTML(encodeHtml(message)) }} />
: <StackTrace error={err} />
: <StackTrace error={error} />
}
</div>
)
Expand Down