简体   繁体   English

React.JS onChange事件不适用于unity-webgl

[英]React.JS onChange event not working with using 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>
}

Here onChange(Input) event was working well but after Unity integration it does not work at all. 这里的onChange(Input)事件运行良好,但是在Unity集成后它根本无法工作。 I tried with other input components but same result. 我尝试了其他输入组件,但结果相同。

I solved this problem by myself and I posted the answer via below links. 我自己解决了这个问题,并通过以下链接发布了答案。

Here are the answer for this question. 这是这个问题的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM