renamed ErrorBoundary prop name to componentName

This commit is contained in:
Ben Wheeler 2019-10-11 16:25:19 -04:00
parent 46660a2ff9
commit 226134bc81
5 changed files with 8 additions and 8 deletions

View file

@ -18,8 +18,8 @@ class ErrorBoundary extends React.Component {
// Display fallback UI
Sentry.withScope(scope => {
scope.setTag('project', 'scratch-www');
if (this.props.name) {
scope.setTag('component', this.props.name);
if (this.props.componentName) {
scope.setTag('component', this.props.componentName);
}
Object.keys(errorInfo).forEach(key => {
scope.setExtra(key, errorInfo[key]);
@ -51,7 +51,7 @@ class ErrorBoundary extends React.Component {
}
ErrorBoundary.propTypes = {
children: PropTypes.node,
name: PropTypes.string
componentName: PropTypes.string
};
module.exports = ErrorBoundary;

View file

@ -10,7 +10,7 @@ const Page = ({
children,
className
}) => (
<ErrorBoundary name="Page">
<ErrorBoundary componentName="Page">
<div className={classNames('page', className)}>
<div
className={classNames({

View file

@ -10,7 +10,7 @@ initSentry();
require('./join.scss');
const Register = () => (
<ErrorBoundary name="Join">
<ErrorBoundary componentName="Join">
<div className="join">
<a
aria-label="Scratch"

View file

@ -13,7 +13,7 @@ const UnsupportedBrowser = require('./unsupported-browser.jsx');
if (isSupportedBrowser()) {
const EmbedView = require('./embed-view.jsx');
render(
<ErrorBoundary name="EmbedView">
<ErrorBoundary componentName="EmbedView">
<EmbedView.View />
</ErrorBoundary>,
document.getElementById('app'),
@ -29,7 +29,7 @@ if (isSupportedBrowser()) {
);
} else {
render(
<ErrorBoundary name="UnsupportedBrowser"><UnsupportedBrowser /></ErrorBoundary>,
<ErrorBoundary componentName="UnsupportedBrowser"><UnsupportedBrowser /></ErrorBoundary>,
document.getElementById('app')
);
}

View file

@ -41,7 +41,7 @@ describe('ErrorBoundary', () => {
beforeEach(() => {
errorBoundaryWrapper = mountWithIntl(
<ErrorBoundary
name="TestEBName"
componentName="TestEBName"
>
<ChildClass id="childClass" />
</ErrorBoundary>