-
Nested block is redundant리액트 - ReactJS/오류 2022. 12. 1. 17:55
1. 현상
함수 작성 중 발생
코드 진행은 되지만 메세지가 계속 생성됨
const handleSearch = () => { { setOpen(true); } };
2. 원인
내부에 이중 블록이 있음
{
{
}
}
한개씩 있어야 하는데 두개가 작성되어 에러메세지 발생
3. 해결
{} 한개 삭제
const handleSearch = () => { setOpen(true); };
에러메세지 발생하지 않음
'리액트 - ReactJS > 오류' 카테고리의 다른 글
caniuse-lite is outdated. (0) 2022.12.21 React Hook useEffect has missing dependencies (0) 2022.12.01 gyp ERR! not ok (0) 2022.11.11 Unexpected token, expected "jsxTagEnd" (0) 2022.10.01 Module not found: Error: Can't resolve 'fs' in dotenv (0) 2022.10.01