The problem is that you are using invalid syntax. I think your intention was to use a class since you mention that you are using import
it is very likely that you have support for classes as well.
Your render method would be a method of the class and the class the component as such.
import React, { Component} from 'react';
class MiComponente extends Component {
render() {
this.customize();
return (
<ReactF1 id="ResponsiveHeader" data-f1= "header" >
<h1>Hola</h1>
</ReactF1>
);
}
}
export default MiComponente;
Read link
I do not know what the this.customize()
function is, but it seems to me that what you are creating is a presentation component, so you should not include another code in the render function unless it is needed by a library.
Read link
If you are not using ES6 you should use this syntax where the render method is a property of an object
var MiComponente = React.createClass({
render: function() {
return (
<ReactF1 id="ResponsiveHeader" data-f1="header">
<h1>Hola</h1>
</ReactF1>
)
}
});
Read link
If you notice the declaration render
must carry the identifier function
, since it is a function or be a member of a class of ES6 not to take it.