eslint

🚪 ESLint 에러로 번역하자면 삼항 표현식을 중첩하지 마십시오. 관리자 혹은 본인만 삭제할 수 있는 버튼을 만드는 과정입니다. userId를 받아와서 'admin'이면 버튼을 생성하고 아니면 해당 게시물의 ID와 비교해서 일치하면 버튼을 생성한다. actions={ /* eslint-disable-next-line no-nested-ternary */ (userId === 'admin') ? this.buttonCreate(props) : (props.userID === userId) ? this.buttonCreate(props) : ''} buttonCreate = (props) => { return [ this.replyDelete(props)}> {translate('delete')}]; }..
벨보이
'eslint' 태그의 글 목록