React: Expected an assignment or function call and instead saw an expression

前端 未结 8 1403
一个人的身影
一个人的身影 2020-11-27 05:40

I am trying to fix this lint error at line const def = (props) => { in following sample code.

const propTypes = {
prop1: PropTypes.string,
pr         


        
8条回答
  •  佛祖请我去吃肉
    2020-11-27 06:21

    You must return something

    instead of this (this is not the right way)

    const def = (props) => { 
    };

    try

    const def = (props) => ( 
    );

    or use return statement

    const def = (props) => { return  
    };

提交回复
热议问题