React.JS onChange事件无法使用unity-webgl

时间:2017-10-19 16:54:15

标签: javascript reactjs input onchange unity-webgl

import {Unity} from 'react-unity-webgl';

...

handleChange(event) {
    console.log(event.target.value);
}

render() {
    <div>
 ...
        <div>
            <Unity src="WebGL.json" />
        </div>
 ...
    <div>
      <input type="text" name="title" id="title" value={this.state.value} onChange={this.handleChange} />
    </div>
 ...
  </div>
}

这里onChange(输入)事件运行良好但在Unity集成之后它根本不起作用。我尝试了其他输入组件,但结果相同。

1 个答案:

答案 0 :(得分:0)

我自己解决了这个问题,并通过以下链接发布了答案。

Here are the answer for this question.