-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Yellow Box for react-dom #7360
Yellow Box for react-dom #7360
Conversation
|
||
const YellowBoxMessage = require('ReactDOMYellowBoxMessage'); | ||
|
||
import type {Format, Instance, Milliseconds, InstanceInfo} from 'reactShowWarningDOM'; |
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 depends on a later commit. :\
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.
Oops, sorry didn't notice that :|
Just rebased and updated. https://jsfiddle.net/keyanzhang/mmupy3zh/15/embedded/result/ |
Beyond another rebase, is there further work to be done here before this lands? :) |
@addyosmani it depends on facebook/fbjs#165 (which itself requires some rebasing), and it will also need to be implemented in It's not clear what the status is here since it's been sitting here for so long without review, maybe @spicyj or @gaearon can clarify whether this is something that we still want to do. |
I believe this is on pause until we figure out a good public API for exposing hooks to warning and error reporting. @bvaughn built a version we use internally at Facebook that will inform what we do in open source. |
There was also a related exploration on #8861 but as Andrew said, the team decided to put yellow box on hold for now in favor of higher-priority v16 stuff. We'll revisit it soon hopefully. 😄 |
I think it's okay to close this PR for now. We may still end up using this as a starting point for whatever we do merge, but it's unlikely to be merged as-is. |
@addyosmani thanks for bringing this to our attention again! |
This is a port of React Native's Yellow Box to
react-dom
. It's also similar to our internalErrorMessageConsole
module at Facebook.It requires facebook/fbjs#165 which passes warning info from
warning(...)
to__showWarning(...)
(the new global hook installed byreact-dom
).A demo can be found here: https://jsfiddle.net/keyanzhang/mmupy3zh/15/embedded/result/. There's no fancy styling since we want to keep this component as simple as possible.
Thanks for reviewing! @spicyj