React

React

[React] ❌ TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'

🥹 api request 테스터를 하던중 위와 같은 문제가 발생했다api요청으로 데이터가 잘 넘어오는지 확인하기 위해 기존에 로컬 더미로 꾸며진 html 태그는모두 주석처리한상태 async render() { console.log('🎨 ProductGrid 렌더링 시작'); try { console.log('📦 ProductGrid 렌더링 시작'); const response = await this.apiManager.getProducts(); console.log(`✅ ProductGrid 렌더링 완료 : ${response}`); this.product = response?.results ?? []; this.createElement(); ..

React

[React] index.js:6 Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API

React18에서 ReactDOM.render 가 더이상 사용되지 않음 / 렌더링 방식을 변경해야한다 🧤beforeimport React from 'react';import ReactDOM from 'react-dom';import App from './App';ReactDOM.render( , document.getElementById('root'));  👡afterimport React from 'react';import ReactDOM from 'react-dom/client'; // React 18에서 새로 추가된 importimport './index.css'; import App from './App'; const root = ReactDOM.createRoot(docum..

React

[React] vite 프로젝트 생성하기

npm create vite@latestoryarn create vite  UIFramework 골라주고 Typescripts 가 javascripts 를 포함할 수 있으니 Typescripts로 진행 내 npm 현재 버전 9.6.4 로  npm7+ 버전 명령어를 사용함npm create vite@latest my-vite-app -- --template react (npm 6.x 사용 시) -- 이 한번 빠짐npm create vite@latest my-vite-app --template vue 해당 프로젝트 폴더에 들어가서 cd my-vite-app  npm installnpm run dev  vitesms 개발 서버 포트가 3000번이 아니고 5173 번이다 http://localhost:5173/..

여미미
'React' 카테고리의 글 목록