简体   繁体   English

React.js输入性能

[英]React.js input performance

I try to set up some inputs on page with EN value (left column inputs) and RU value (right column inputs). 我尝试在页面上设置一些输入,其中包含EN值(左列输入)和RU值(右列输入)。 Input with EN value is read-only. 带EN值的输入是只读的。 Input with RU value can be changed. 可以更改带RU值的输入。

After change I can POST my new value to server. 更改后,我可以将新值发布到服务器。

What I don't understand: in file scripts/react/components/InputsRow.js:61 I have a DIV element, and all OK. 我不明白:在文件脚本/ react / components / InputsRow.js:61我有一个DIV元素,一切都OK。 Github link Github链接

render: function() {
var result = this.state.data,
    keys = result.keys,
    values = result.values,
    locale_id = result.locale_id,
    project_id = result.project_id,
    version_id = result.version_id,
    self = this;

console.log('<InputsRow /> render');

var inputNodes = keys.map && keys.map(function(item, keyIndex) {
  var keyId = item.id;
  return (
    <div className="row" key={keyIndex} className={'inputs-row ' + (item.disabled ? 'inputs-row_disabled':'')}>
      <div className="col-md-12">
        <div className="col-md-6 form-group">
          <div className="input-group">
            <div className="input-group-addon">
              <i className="fa fa-info fa-fw"></i>
            </div>
            {/*<input className="key-input form-control" value={item.name} onClick={self.onInputKeyClick.bind(self,item)} readOnly />*/}
            <div className="key-input form-control">{item.name}</div>
          </div>
        </div>
        <LocalValues localObj={values[keyId]} locale_id={locale_id} project_id={project_id} sendItem={self.sendItem} key_id= {keyId}/>
      </div>
    </div>
  );
});
return (
  <div>
    <div>{inputNodes}</div>
  </div>
)

}, },

If you try to uncomment line 60 and comment line 61 - you get a problem with 'RU inputs'. 如果您尝试取消注释第60行和注释第61行 - 您会遇到'RU输入'的问题。 When you typed any symbols - it's will work so slowly... 当你输入任何符号时 - 它的工作速度会很慢......

I have a git repo for best declaration this problem: 我有一个git repo最好的声明这个问题:

https://github.com/maxfarseer/react-inputs https://github.com/maxfarseer/react-inputs

PS 'RU inputs' = right column. PS'RU输入'=右列。

In my case it was chrome bug (?). 在我的情况下,它是铬虫(?)。 I download chrome nightly and haven't problems with perfomance. 我每晚下载chrome并且没有性能问题。 Try to do same in last Safari - no problems again. 尝试在最后的Safari中做同样的事情 - 再没有问题。 I try to disable all extensions and try to disable all bootstrap styles on this input - nothings happen. 我尝试禁用所有扩展并尝试禁用此输入上的所有引导样式 - 没有发生。

(stable) Chrome 43.0.2357.130 (64-bit) has perfomance problem (稳定)Chrome 43.0.2357.130(64位)有性能问题

(nightly) Chrome 45.0.2452.0 canary (64-bit) - no problems (每晚)Chrome 45.0.2452.0金丝雀(64位) - 没问题

(stable) Safari 8.0.7 (10600.7.12) - no problems (稳定)Safari 8.0.7(10600.7.12) - 没问题

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

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