Open irudoy opened 5 years ago
test('React.renderToString inside a function', async ({ is }) => {
const src =
`import React from 'react';
import ReactDOMServer from 'react-dom/server';
function foo() {
const A = () => <div/>;
ReactDOMServer.renderToString(<A/>);
};`
const esx =
`const esx = require('esx')();
import React from 'react';
import ReactDOMServer from 'react-dom/server';
function foo() {
const A = () => esx \`<div/>\`;
esx.renderToString("A", A) \`<A/>\`;
};`
is(convert(src), esx)
})
Input
Output