如何将函数转换为es6箭头函数

时间:2019-11-11 10:31:33

标签: reactjs ecmascript-6 arrow-functions

我需要使用ES 6将以下功能写入箭头功能。下面我给了function.in reactjs

//

        tab_Row(){
          return this.state.business.map(function(object, i){
              return <Table_Row  />;
          });
        }

3 个答案:

答案 0 :(得分:1)

您可以这样-

 tab_Row = () => {
          return this.state.business.map((object, i) => {
              return <Table_Row  />;
          });
        }

答案 1 :(得分:0)

您可以像这样为上述代码编写ES-6语法

 const tab_Row = () => {
          return this.state.business.map((object, i) => {
              return <Table_Row  />;
          });
        }

答案 2 :(得分:0)

您无法弄清楚的问题到底是什么?

   tab_Row = () => {
          return this.state.business.map((object, i) => {
              return <Table_Row  />;
          });
        }
相关问题