Skip to content

Commit

Permalink
restore react 15 compact
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Dec 11, 2018
1 parent af1aa39 commit bdd2659
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/errorReporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ const overlayStyle = {
const listStyle = {}

const mapError = ({ error, errorInfo }) => (
<React.Fragment>
<div>
<p style={{ color: 'red' }}>
{error.toString ? error.toString() : error.message || 'undefined error'}
</p>
{errorInfo && (
<React.Fragment>
<div>
<div>Stacktrace:</div>
<ul style={{ color: 'red', marginTop: '10px' }}>
{errorInfo.componentStack
.split('\n')
.map((line, i) => <li key={String(i)}>{line}</li>)}
</ul>
</React.Fragment>
</div>
)}
</React.Fragment>
</div>
)

class ErrorOverlay extends React.Component {
Expand Down
2 changes: 1 addition & 1 deletion src/global/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export const isOpened = sourceModule =>
sourceModule && !!openedModules[sourceModule.id]

export const enter = sourceModule => {
lastModuleOpened = sourceModule.id
if (sourceModule && sourceModule.id) {
lastModuleOpened = sourceModule.id
openedModules[sourceModule.id] = true
} else {
logger.warn(
Expand Down
1 change: 1 addition & 0 deletions test/hot.dev.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ describe('hot (dev)', () => {

it('should trigger error in unmount in opened state', () => {
const sourceModule = { id: 'error42_unmount' }
logger.error.mockClear()
enterModule(sourceModule)
const Component = () => <div>123</div>
const HotComponent = hot(sourceModule)(Component)
Expand Down

0 comments on commit bdd2659

Please sign in to comment.