Hi
I have installed this plugin but having problems.
$ npm install jsx-to-html
myreactfile.jsx
import React, { Component } from 'react';
import { render } from 'jsx-to-html';
class App extends Component {
getComp(){
var content = render(<div className="hello">hello</div>);
console.log('content = ', content);
return ('<div>hello</div>');
}
render() {
return (
<div className="all">
{this.getComp()}
</div>
)
}
}
ReactDOM.render(
<App/>,
document.getElementById('app')
);
I am getting error:
Uncaught Error: Top level element should be a tag or function which returns a tag
I have tried adding the plugin via .babelrc but that gives me an error too so I'm not entirely sure the plugin has loaded:
.babelrc
{
"presets" : ["es2015", "react"],
"plugins": [
["jsx-to-html/babel-plugin",
{
"blacklist": ["react"]
}]
]
}
Hi
I have installed this plugin but having problems.
$ npm install jsx-to-html
myreactfile.jsx
I am getting error:
Uncaught Error: Top level element should be a tag or function which returns a tagI have tried adding the plugin via .babelrc but that gives me an error too so I'm not entirely sure the plugin has loaded:
.babelrc