Fix Flipper crashing to an empty screen

Summary:
Changelog: Fixed issue where a Flipper crash would result in an entirely blank screen, rather than a useful error message.

While debugging another issue, discovered that React errors that happen outside a Plugin aren't caught at all, resulting in the infamous gray screen of deaths. This was the case because no error boundary has been set up for our Chrome, and since React 16 the default error handling has becoming rendering blank, rather than freezing. See https://reactjs.org/docs/error-boundaries.html#new-behavior-for-uncaught-errors.

Thanks to ant.design styling this decently was trivial :). But sadly involved a component class since error boundaries are not yet available as hook.

With these changes the errors should also end up more readably in our monitoring.

Reviewed By: nikoant

Differential Revision: D26422666

fbshipit-source-id: 6c0f8611c80a4a5e0d7e61d58afcf5eabe410e57
This commit is contained in:
Michel Weststrate
2021-02-12 06:42:34 -08:00
committed by Facebook GitHub Bot
parent 11548c9cd6
commit 4964966b91
2 changed files with 102 additions and 17 deletions

View File

@@ -139,6 +139,7 @@ type SplitLayoutProps = {
*/
center?: boolean;
children: [React.ReactNode, React.ReactNode];
style?: React.HTMLAttributes<HTMLDivElement>['style'];
};
function renderSplitLayout(