반응형

reactjs 10

모듈 빌드 실패:참조 오류: [BABEL]

모듈 빌드 실패:참조 오류: [BABEL] 이 구성을 가지고 있습니다. 패키지.json { "name": "app02", "version": "1.0.0", "description": "", "main": "webpack.config.js", "dependencies": { "react": "^0.14.3" }, "devDependencies": { "babel-core": "^6.2.1", "babel-loader": "^6.2.0", "babel-preset-es2015": "^6.1.18" }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "private": tr..

programing 2023.04.03

npm ERR! 코드 UNABLE_TO_GET_ISSUER_CERT_LOCALY

npm ERR! 코드 UNABLE_TO_GET_ISSUER_CERT_LOCALY React 어플리케이션을 만들기 위해 가능한 모든 방법을 시도하고 있습니다.해 보고, 시험해 보고 .create-react-app페이스북 인큐베이터 를 때create-react-app my-app했습니다.npm 환 、 pm 、 pm 、 in 、 in 、 in 、 in 、 in in in in in 。그러나 작업 환경에서 동일한 명령을 시도했을 때 명령줄에서 다음 오류가 발생했습니다. npm ERR! node v6.10.2 npm ERR! npm v3.10.10 npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY npm ERR! unable to get local issuer certifica..

programing 2023.04.03

Respect dev 도구 - "경고 시 중단" 비활성화

Respect dev 도구 - "경고 시 중단" 비활성화 create-react-app을 사용하여 개발하는 동안 브라우저가 다음과 같은 경고로 디버거 모드로 전환됩니다. react-dev-tools의 소스 코드를 끊습니다. // --- Welcome to debugging with React DevTools --- // This debugger statement means that you've enabled the "break on warnings" feature. // Use the browser's Call Stack panel to step out of this override function- // to where the original warning or error was logged. 이 동작..

programing 2023.03.29

React에서 클래스의 컨스트럭터에서 setState() 함수를 사용하면 어떻게 됩니까?JS 또는 리액트 네이티브?

React에서 클래스의 컨스트럭터에서 setState() 함수를 사용하면 어떻게 됩니까?JS 또는 리액트 네이티브? 그냥 궁금해서 그러는데, 만약 내가 이걸 쓰면 어떻게 되는지 알고 싶어.setState()React Native 또는 ReactJS 클래스의 생성자 함수예를 들어 다음과 같습니다. constructor(props) { super(props); this.setState({title: 'new title'}); } 리액트의 라이프 사이클은 어떻게 될까요? 리액트 안에 있는 코드를 못 읽었어요그렇게 쓰면 좀 상할까 봐 걱정이에요.뭐?setState기본적으로는 컨스트럭터에서 필요 없는 논리들을 실행하는 것입니다. 갈 때state = {foo : "bar"}javascript 객체에 무언가를 할당하..

programing 2023.03.29

NPM - 구성 내 env 대체 실패: ${NPM_토큰}

NPM - 구성 내 env 대체 실패: ${NPM_토큰} 리액트 앱을 구축하려고 하는데 명령어를 실행하면npm -i다음의 에러가 표시됩니다. Error: Failed to replace env in config: ${NPM_TOKEN} at /usr/local/lib/node_modules/npm/lib/config/core.js:415:13 at String.replace () at envReplace (/usr/local/lib/node_modules/npm/lib/config/core.js:411:12) at parseField (/usr/local/lib/node_modules/npm/lib/config/core.js:389:7) at /usr/local/lib/node_modules/npm/li..

programing 2023.03.19

react.js에서의 setState와 replaceState의 비교

react.js에서의 setState와 replaceState의 비교 React.js 라이브러리는 처음이고 튜토리얼을 몇 가지 살펴보던 중 다음과 같은 사실을 알게 되었습니다. this.setState this.replaceState 지정된 설명은 매우 명확하지 않습니다(IMO). setState is done to 'set' the state of a value, even if its already set in the 'getInitialState' function. 유사하게, The replaceState() method is for when you want to clear out the values already in state, and add new ones. 에 이어 console.log를 해보..

programing 2023.03.19

react typescript testing TypeError: MutationObserver는 컨스트럭터가 아닙니다.

react typescript testing TypeError: MutationObserver는 컨스트럭터가 아닙니다. 리액트 앱을 만들었습니다.create-react저번주. [ Submit ]를 클릭하면 메시지가 표시되는 간단한 폼이 있습니다. 테스트하고 싶습니다.이것은 제가 작성한 테스트입니다.SampleForm.test.tsx: import React from "react"; import { render, fireEvent, screen, waitFor } from "@testing-library/react"; import SampleForm from "./SampleForm"; import "@testing-library/jest-dom/extend-expect" test("renders subm..

programing 2023.03.19

Isomiform React 컴포넌트에서의 CSS 파일 Import

Isomiform React 컴포넌트에서의 CSS 파일 Import ES6에서 작성된 구성 요소가 포함된 리액트 응용 프로그램이 있으며, Babel 및 Webpack을 통해 변환됩니다. react webpack cookbook에 제시된 바와 같이 특정 컴포넌트에 특정 CSS 파일을 포함시키고 싶은 곳도 있습니다. 단, 컴포넌트 파일에서 다음과 같은 정적 CSS 자산이 필요한 경우: import '../assets/css/style.css'; 그러면 컴파일이 실패하고 다음 오류가 발생합니다. SyntaxError: /assets/css/style.css: Unexpected character '#' (3:0) at Parser.pp.raise (\node_modules\babel-core\lib\acorn..

programing 2023.03.14

CodeClimate 메서드 라인 검사에서 렌더링 함수 필터링

CodeClimate 메서드 라인 검사에서 렌더링 함수 필터링 CodeClimate를 프로젝트에 추가하고 많은 데이터 센터와method-lines에러renderReact 컴포함되어 있습니다. 예:- 기능.render에는 78행의 코드가 있습니다(최대 40행 사용 가능).리팩터링을 검토해 주세요. 우리는 우리의 모든 것을 걸러내고 싶다.render에서의 기능method-lines체크. 회선 임계값을 높이거나 체크 기능을 모두 해제할 수 있지만 다른 기능을 체크하고 싶기 때문에 바람직하지 않습니다. 중복 검사를 위한 노드 필터링이 있지만 유사한 항목을 찾을 수 없습니다.method-lines.메서드 행 체크에서 특정 함수를 제외하려면 CodeClimate에서 .codeclimate.yml 파일에서 metho..

programing 2023.03.14

React Component를 컨테이너 컴포넌트의 기능 사이에 인수로 전달할 수 있습니까?

React Component를 컨테이너 컴포넌트의 기능 사이에 인수로 전달할 수 있습니까? 하위 구성 요소를 상위 구성 요소의 함수에 인수로 전달하고 렌더링하려고 하면 작동하지 않습니다. //React Container Component //Import Both Views and Render based on preference import PosterView from "./PosterView" import ListView from "./ListViewCard" ... renderCardsBasedOnType(cardType){ if(cardType === "poster"){ return this.renderCards(PosterView) }else{ return this.renderCards(ListVi..

programing 2023.03.14
반응형