We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa99d61 commit dc06b64Copy full SHA for dc06b64
packages/react-on-rails-pro/src/handleError.ts
@@ -1,13 +1,9 @@
1
-import * as React from 'react';
2
import { Readable } from 'stream';
3
import { ErrorOptions } from 'react-on-rails/types';
4
-import { renderToString } from 'react-on-rails/ReactDOMServer';
5
-import generateRenderingErrorMessage from 'react-on-rails/generateRenderingErrorMessage';
+import handleErrorAsString from 'react-on-rails/handleError';
6
7
const handleError = (options: ErrorOptions) => {
8
- const msg = generateRenderingErrorMessage(options);
9
- const reactElement = React.createElement('pre', null, msg);
10
- const htmlString = renderToString(reactElement);
+ const htmlString = handleErrorAsString(options);
11
return Readable.from([htmlString]);
12
};
13
0 commit comments