Skip to content

Commit 86661f6

Browse files
committed
Fully es5ify
1 parent b307b42 commit 86661f6

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

index.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
const React = require('react');
22

33
const ansiToJSON = require('ansi-to-json');
44

@@ -21,18 +21,14 @@ function ansiToInlineStyle(text) {
2121
}
2222

2323
function inlineBundleToReact(bundle, key) {
24-
return (
25-
<span style={bundle.style} key={key}>{bundle.content}</span>
26-
);
24+
return React.createElement('span', {
25+
style: bundle.style,
26+
key,
27+
}, bundle.content);
2728
}
2829

2930
function Ansi(props) {
30-
const { text } = props;
31-
return (
32-
<code>
33-
{ansiToInlineStyle(text).map(inlineBundleToReact)}
34-
</code>
35-
);
31+
return React.createElement('code', {}, ansiToInlineStyle(props.text).map(inlineBundleToReact));
3632
}
3733

3834
Ansi.propTypes = {

0 commit comments

Comments
 (0)