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 b307b42 commit 86661f6Copy full SHA for 86661f6
index.js
@@ -1,4 +1,4 @@
1
-import React from 'react';
+const React = require('react');
2
3
const ansiToJSON = require('ansi-to-json');
4
@@ -21,18 +21,14 @@ function ansiToInlineStyle(text) {
21
}
22
23
function inlineBundleToReact(bundle, key) {
24
- return (
25
- <span style={bundle.style} key={key}>{bundle.content}</span>
26
- );
+ return React.createElement('span', {
+ style: bundle.style,
+ key,
27
+ }, bundle.content);
28
29
30
function Ansi(props) {
- const { text } = props;
31
32
- <code>
33
- {ansiToInlineStyle(text).map(inlineBundleToReact)}
34
- </code>
35
+ return React.createElement('code', {}, ansiToInlineStyle(props.text).map(inlineBundleToReact));
36
37
38
Ansi.propTypes = {
0 commit comments