본문 바로가기

반응형

개발자정보

(319)
html react 변환 for HTML 예시Username: 변환된 JSXimport React from 'react';function MyComponent() { return ( Username: );}export default MyComponent; 주요 변경 사항for 속성을 htmlFor로 변경합니다.
React Network Error 해결 방법 로컬에서 React 띄우고 서버에 있는 URL를 호출하면 Network 오류 발생 해결 방법 package.json"proxy": "http://www.sample.com/getDataList.php",  php 사용 할 경우 아래 스크립트 추가해 준다.header("Access-Control-Allow-Origin: *");header("Content-Type: application/json; charset=UTF-8");  header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Methods: POST, GET, OPTIONS"); header("Access-Control-Allow-Headers: Content-Type")
Github에 node_modules 폴더 제외하는 방법 .gitignore 파일을 생성한다.# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.# dependencies/node_modules/.pnp.pnp.js# testing/coverage# production/build# misc.DS_Store.env.local.env.development.local.env.test.local.env.production.localnpm-debug.log*yarn-debug.log*yarn-error.log*
redirect in react 18에 오류 해결 방법 import { Navigate } from 'react-router-dom'; } /> import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';import ErrorPage from './ErrorPage';import Home from './Home';function App() { return ( } /> {/* The next line is very important for the Navigate component to work */} } /> ..
This expression is not callable. Type 'typeof import("X:/xxx/node_modules/date-fns/format")' has no call signatures. 오류발생 부분export function formatDate(date: Date) { return format(date, 'yyyyMMdd') ;}  수정export function formatDate(date: Date): string { const day = date.getDate().toString().padStart(2, '0'); const month = (date.getMonth() + 1).toString().padStart(2, '0'); const year = date.getFullYear(); return `${year}${month}${day}`; // return format(date, 'yyyyMMdd') ;}
React, Module '"react-i18next"' has no exported member 'TFunction'. 오류 해결 Module '"react-i18next"' has no exported member 'TFunction'. 오류 발생. 아래 실행하여 해결yarn add react-i18next@11.8.15 --save-dev
Cannot find module 'ag-grid-react' or its corresponding type declarations. 오류 해결 아래 명령어 실행 후 정상 작동 yarn add ag-grid-react --save-dev
mui listitem Property 'button' does not exist on type // v4...// v5 ...

반응형