Hi, I want to know how do I inject a react data table into a single view of an existing yii project.
I found a related thread in here (http://www.yiiframework.com/forum/index.php/topic/73578-implement-react-js-in-yii2/) and tried according to it, but it’s not working.
At this point, the view can access my js file, but it does not render the react html section. Also, there is no any error displaying.
Here is my js file:(web/js/react-table.js)
var SimpleComponent = React.createClass({
render: function() {
return (
<div>{this.props.message}</div>
);
}
} );
ReactDOM.render(
<SimpleComponent message="React Demo" />,
document.querySelector( '.test' )
);
In view file there is a <div class="test"> to get the component property values.
Can anyone please explain what is wrong in here. Thanks in advance…!