-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Docs for Error Boundaries #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deploy preview ready! Built with commit 03dae5b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Thanks for the contribution!
Couple of minor tweaks requested.
content/docs/error-boundaries.md
Outdated
showButton(); | ||
} catch (error) { | ||
// ... | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: You can get rid of this indentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bump this nit ^
content/docs/error-boundaries.md
Outdated
However, React components are declarative and specify *what* should be rendered: | ||
|
||
```js | ||
<Button /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Ditto about indentation.
content/docs/error-boundaries.md
Outdated
|
||
React 16 prints all errors that occurred during rendering to the console in development, even if the application accidentally swallows them. In addition to the error message and the JavaScript stack, it also provides component stack traces. Now you can see where exactly in the component tree the failure has happened: | ||
|
||
<img src="../images/docs/error-boundaries-error-log.png" style="max-width:100%" alt="Error caught by Error Boundary component"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be nice to share these images between the blog post and the docs page, since they're the same. Maybe git mv
the images into images/docs
and then update the blog markdown to reference them there?
content/docs/error-boundaries.md
Outdated
|
||
Note that **error boundaries only catch errors in the components below them in the tree**. An error boundary can’t catch an error within itself. If an error boundary fails trying to render the error message, the error will propagate to the closest error boundary above it. This, too, is similar to how catch {} block works in JavaScript. | ||
|
||
#### componentDidCatch Parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I think this should be an <h3>
(eg ###
) rather than <h4>
06b220b
to
96e65ae
Compare
Thanks @bvaughn |
Oooh, one more thing! We require contributors to sign our Contributor License Agreement, and I don't think we have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. (Sorry for the awkwardness here. I'm still getting the new repo setup. Normally this comment is automated.) |
No worries, I've already signed it :) |
Great 😄 Thanks for confirming. Just need to fix the tiny indentation issue and this looks good to go! |
96e65ae
to
03dae5b
Compare
@bvaughn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries. Thanks!
* translate React API Reference * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md Co-Authored-By: renato-bohler <renato.bohler@gmail.com> * Update content/docs/reference-react.md * Update content/docs/reference-react.md
Hey,
Moved this PR here, as said :)