React

React

localhost에 https 인증서 설치하기 - 리액트 mkcert chocolatey 설치

리액트 PWA를 실행하려면  mkcert 를 설치하라고 하는데.. mkcer를 설치하려면 그전에 먼저 chocolatey 를 설치하라고 한다..  1. Window Powershell 을 관리자 권한으로 실행한다.2. 아래를 입력한다.$ Get-ExecutionPolicy 결과 화면이  Restricted가 아닐 경우 Set-ExecutionPolicy AllSigned 실행 후 Y 입력 3. 다음 코드를 입력한다.Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;..

React

useInfiniteQuery 사용하기

import React, { useContext, useEffect, useRef, useState } from 'react'; import { LocalStateContext } from '../../api/LocalStateContext'; import { DownChevronSvg } from '../svgs/ButtonSvg'; import { useInfiniteQuery } from '@tanstack/react-query'; import { useAxiosAuth } from '../../api'; import { Tooltip as ReactTooltip } from 'react-tooltip'; const ImgSlide = ({ openState, setOpenState }: any) ..

React

Formdata에 array를 string으로 넣기

해결해야 하는 상황: formdata에 값을 'string'으로 넣어야한다. data의 type은 object이다 (객체) 내가 전달하고자 하는 값은 Formdata.append('cate1', cate1) 인데, 이 cate1은 ['1','3'] 이런 식의 배열이었다 나는 1, 3 ... 이런식으로 string으로 보내야 하는 상황이다. 해결방법 : data를 배열로 만든 후 map 메서드로 원하는대로 데이터를 가공하자. 배열의 map 메서드를 사용하면 데이터를 원하는 대로 가공할 수 있다. const editData = [data].map(i => ({ //data를 [ ]로 감싼다 Category1: i.anatdelProductCategory1.join(','), Category2: i.anatd..

React

tailwind font 폰트 테마 설정하기

tailwind.config.js 에 폰트 테마를 설정했다. module.exports = { future: { removeDeprecatedGapUtilities: true, purgeLayersByDefault: true, }, content: ['./src/**/*.{js,ts,jsx,tsx}'], darkMode: 'class', theme: { extend: { screens: {}, colors: { white: '#FFFFFF', mainColor: '#004C7E', subColor: '#F5F5F5', newsContent: '#757575', headerFooterColor: '#30363A', header: { blackbg: '#30363A', white: '#fff', }, }, ..

React

nextjs tailwind sass 함께 쓰기

참고글 여기를 보고 완료했다. 아래 링크에서 설치하란대로 다 하면 왠만하면 실행이 될것이나 나의 경우에는 좀더 풀어 써보려고 한다. https://imranhsayed.medium.com/next-js-tailwindcss-with-sass-example-41eae3e38206 Next.js Tailwindcss with SASS example Tailwind CSS is a highly customizable, low-level CSS framework that gives you all of the building blocks you need to build bespoke designs… imranhsayed.medium.com 링크에서 터미널 명령어 설치하란대로 다 설치했다는 가정 하에 밑의 글은 참..

React

Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up ..

리액트 오류: Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.Check the render method of `Field`. Check the render method of `Field` 그런데 아무리 살펴봐도 나는 'Field' 라는 것을 쓰거나, 오타가 난..

Mori_FEDev
'React' 카테고리의 글 목록