Skip to content

Commit

Permalink
fix: rethrow an error is hot comparison is not open
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Feb 20, 2019
1 parent 8240111 commit 8befa5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/AppContainer.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class AppContainer extends React.Component {

// trigger update to kick error
this.setState({})
throw error
return
}
const { errorReporter = configuration.errorReporter } = this.props
Expand Down
4 changes: 4 additions & 0 deletions src/reconciler/proxyAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react'
import {
enterHotUpdate,
get as getGeneration,
hotComparisonOpen,
setComparisonHooks,
} from '../global/generation'
import { getProxyByType, setStandInOptions } from './proxies'
Expand Down Expand Up @@ -115,6 +116,9 @@ export function retryHotLoaderError() {
setComparisonHooks(
() => ({}),
component => {
if (!hotComparisonOpen()) {
return
}
const { prototype } = component
if (!prototype[OLD_RENDER]) {
const renderDescriptior = Object.getOwnPropertyDescriptor(
Expand Down

0 comments on commit 8befa5a

Please sign in to comment.