위에서 오류가 났다. isQualified는 filter메서드에 넣어지는 함수이다.

 

해결법

1. {} 를 ()로 바꿔준다

2. {} 를 쓰고 싶다면, { return ~~~}로 작성해준다.

 

화살표 함수의 주의사항

const Button = () => (
  <button>Submit</button>
)

화살표 함수의 경우 ()로 감싸진 부분이 return으로 넘어간다

이 때에는 return을 작성해주지 않아도 된다.

 

const Button = () => {
  <button>Submit</button>
}
console.log(Button);	// undefined
}

반면에 {}로 감싸진 함수는 return이 없다면 반환하지 않는다.

 

const Button = () => {
    return <button>Submit</button>
}

따라서 {  }로 반환하고 싶다면 위처럼 작성해줘야 한다

 

 

참고, 출처: https://velog.io/@chayezo/%EC%97%90%EB%9F%AC-Expected-an-assignment-or-function-call-and-instead-saw-an-expression-no-unused-expressions

+ Recent posts