From 8dc1902f2f655e26fe86647ea2cb444db69dd694 Mon Sep 17 00:00:00 2001 From: Connor Davis Date: Sat, 1 Dec 2018 15:38:06 -0600 Subject: [PATCH] Add className option --- packages/react-error-overlay/src/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/react-error-overlay/src/index.js b/packages/react-error-overlay/src/index.js index e8fbbb0dfad..511d0b13245 100644 --- a/packages/react-error-overlay/src/index.js +++ b/packages/react-error-overlay/src/index.js @@ -24,6 +24,7 @@ import type { ErrorLocation } from './utils/parseCompileError'; type RuntimeReportingOptions = {| onError: () => void, filename?: string, + className?: string, |}; type EditorHandler = (errorLoc: ErrorLocation) => void; @@ -138,7 +139,13 @@ function update() { // We need to schedule the first render. isLoadingIframe = true; const loadingIframe = window.document.createElement('iframe'); - applyStyles(loadingIframe, iframeStyle); + + if (currentRuntimeErrorOptions && currentRuntimeErrorOptions.className) { + loadingIframe.className = currentRuntimeErrorOptions.className; + } else { + applyStyles(loadingIframe, iframeStyle); + } + loadingIframe.onload = function() { const iframeDocument = loadingIframe.contentDocument; if (iframeDocument != null && iframeDocument.body != null) {