일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- linux
- For
- 블레이드 템플릿
- python
- Switch
- React
- fastapi
- deep learning
- NCP
- nginx
- laravel
- Redis
- AWS
- webpack
- docker
- phpredis
- SQL
- php
- mariadb
- CentOS
- Redux
- Node
- Go
- Machine Learning
- rabbitmq
- javascript
- Babel
- 기초 수학
- nodejs
- Backbone.js
- Today
- Total
개발일기
React - React DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node 에러 본문
React - React DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node 에러
Flashback 2022. 4. 6. 19:10FontAwesome 아이콘을 사용하기 위해 i태그에 해당하는 아이콘 클래스이름을 넣은 후, 페이지를 실행하였을 때, 다음과 같은 에러가 발생하였다.
React DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node
<>
<span>test</span>
<span>
<i className="fas fa-redo" />
</span>
</>
i태그를 위와 같이 사용하였을 때, 에러가 발생하였다.
해결법 : div, span태그로 하위 태그를 감싸준다.
<span>
<span>test</span>
<span>
<i className="fas fa-redo" />
</span>
</span>
// span 또는 div 등의 다른 태그로 감싸주면 에러가 해결된다.
<div>
<span>test</span>
<span>
<i className="fas fa-redo" />
</span>
</div>
위의 소스코드처럼 span태그 또는 div 태그로 해당 내용들을 감싸주면 에러가 해결된다.
노드 패키지 매니저로 FontAwesome 패키지를 설치하고 사용하는법
https://fontawesome.com/v5/docs/web/use-with/react
React
Font Awesome 6 brings loads of new icons and features to the most popular icon set in the world.
fontawesome.com
Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node - 에러 관련 참조글
Failed to execute 'removeChild' on 'Node' with FontAwesome in React
I'm getting the following error whenever I try to use a FontAwesome spinner icon (with className='fa-spin') in React: Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be
stackoverflow.com
'Javascript > React.js' 카테고리의 다른 글
React - useHistory 사용법 (0) | 2022.04.14 |
---|---|
React - Socket.io client/server 활용법 (0) | 2022.04.13 |
React - 컴포넌트의 리렌더링 (0) | 2022.03.24 |
React - useSelector를 활용한 리덕스 상태값 반환 (0) | 2022.03.23 |
React - useDispatch를 사용한 액션 실행 (0) | 2022.03.23 |