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 5712dae commit 1823d38Copy full SHA for 1823d38
src/index.js
@@ -1,15 +1,13 @@
1
-import React, { useRef } from "react";
2
-import Ctx from "./ctx.js";
+import React, {useRef} from 'react';
+import Ctx from './ctx.js';
3
window.React = window.React || React;
4
function StringToReactComponent(props) {
5
const ref = useRef(null),
6
template = props.children;
7
if (!ref.current) {
8
- ref.current = new Ctx(template);
+ ref.current = new Ctx();
9
}
10
- const GeneratedComponent = ref.current
11
- .updateTemplate(template)
12
- .getComponent();
+ const GeneratedComponent = ref.current.updateTemplate(template).getComponent();
13
return <GeneratedComponent {...props} />;
14
15
-export default React.memo(StringToReactComponent);
+export default StringToReactComponent;
0 commit comments