React JSX:Cache Props?

can*_*era 3 reactjs react-jsx

props在React/JSX中多次访问相同的值时,建议将对象缓存在局部变量中吗?

var ItemComponent = React.createClass({

  render: function() {

    var cached = this.props.item;

    return (
      <div className={cached.class}>
        <h1>{cached.heading}</h1>
        <p>{cached.text}</p>
      </div>
    );
  }
});
Run Code Online (Sandbox Code Playgroud)

Mic*_*oix 5

props是一个JavaScript对象只是属性-不是getter函数,所以不应该有任何性能上的显着差异.