Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
file has correct name
Browse files Browse the repository at this point in the history
  • Loading branch information
adjohu committed Sep 4, 2015
1 parent d4e7657 commit a2133e4
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/react-error-suppression.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';

export default function wrapComponent(Component, logErrors = false) {
return class extends Component {
render() {
try {
return super.render();
} catch (e) {
if (logErrors) {
console.log(e);
}

return <div />;
}
}
}
}

0 comments on commit a2133e4

Please sign in to comment.