expected assignment or function call: no-unused-expressions ReactJS

前端 未结 14 828
挽巷
挽巷 2020-12-07 16:26
class Game extends Component 
{
  constructor() 
  {
    super()
    this.state = {
      speed: 0
    }
    //firebaseInit()
  }
  render()
  {
    return 
    (
           


        
14条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-07 17:03

    This happens because you put bracket of return on the next line. That might be a common mistake if you write js without semicolons and use a style where you put opened braces on the next line.

    Interpreter thinks that you return undefined and doesn't check your next line. That's the return operator thing.

    Put your opened bracket on the same line with the return.

提交回复
热议问题