ADD: added function for the dynamic creation of entities

This commit is contained in:
hwinkel
2023-09-07 22:49:49 +02:00
parent 658830bab6
commit b391c8e7ff
4 changed files with 124 additions and 45 deletions

View File

@@ -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>
);
}