ADD: added function for the dynamic creation of entities
This commit is contained in:
@@ -1,12 +1,31 @@
|
||||
import React from 'react';
|
||||
import './controls.css'
|
||||
import { sendMsg } from '../api';
|
||||
|
||||
class Controls extends React.Component
|
||||
{
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.ws = props.ws;
|
||||
|
||||
// This binding is necessary to make `this` work in the callback
|
||||
}
|
||||
getMessage()
|
||||
{
|
||||
var msg =
|
||||
{
|
||||
Type: "Request",
|
||||
Data: "COP"
|
||||
|
||||
}
|
||||
sendMsg(JSON.stringify(msg));
|
||||
console.log("test");
|
||||
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div className="controls">
|
||||
My Application!
|
||||
<button onClick={this.getMessage}> click me!</button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user