Skip to content

Commit 6e74bd8

Browse files
authored
Add note about Function.name to error boundary doc
1 parent d9d6d95 commit 6e74bd8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

content/docs/error-boundaries.md

+4
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ You can also see the filenames and line numbers in the component stack trace. Th
117117

118118
If you don’t use Create React App, you can add [this plugin](https://www.npmjs.com/package/babel-plugin-transform-react-jsx-source) manually to your Babel configuration. Note that it’s intended only for development and **must be disabled in production**.
119119

120+
> Note
121+
>
122+
> Component names displayed in the stack traces depend on the [`Function.name`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name) property. If you support older browsers and devices which may not yet provide this natively (e.g. IE 11), consider including a global polyfill in your bundled application, such as [core-js](https://github.com/zloirock/core-js) or [babel-polyfill](https://babeljs.io/docs/usage/polyfill/). Alternatively, you may explicitly set the [`displayName`](/docs/react-component.html#displayname) property on all your components.
123+
120124

121125
## How About try/catch?
122126

0 commit comments

Comments
 (0)