728x90

https://kciter.so/posts/about-mongodb

 

MongoDB 이해하기

사내에서 MongoDB를 잘 쓰기위한 스터디를 하게되어 이번 기회에 관련 자료를 정리하기로 했다. MongoDB가 왜 필요한지, 더 잘사용하기 위해서 무엇이 필요한지를 중심으로 처음 MongoDB를 사용할 때

kciter.so

 

728x90

'데이터베이스' 카테고리의 다른 글

러닝MySQL 2장 데이터베이스 모델링과 설계  (0) 2024.02.18
GraphQL란?  (0) 2023.02.13
728x90

파일 만들기 

mkdir 파일명

 

파일 미리 만들어놨을 경우, 거기에 리액트까는 법은

cd 파일명

yarn create react-app .

 

커밋할때 모듈 너무 많아서 안될때는

.gitignore

파일 만들고 그 안에 

 

# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

#dependencies
0.5/node_modules
8.4 useMemo/node_modules
9styling-react/node_modules



node_modules/

 

 

이렇게 하니까 모듈 빼고 되더라

 

728x90

'웹 공부' 카테고리의 다른 글

C++ 객체지향프로그램 cout 입력출력  (0) 2021.11.29
객체지향 절차지향  (0) 2021.11.29
toLocaleDateString 날짜 시간 나타내기  (0) 2021.10.27
배열과 객체 차이  (0) 2021.10.27
디버깅/npm/path  (0) 2021.09.24
728x90

   https://react.vlpt.us/basic/12-variable-with-useRef.html

 

12. useRef 로 useRef 로 컴포넌트 안의 변수 만들기 · GitBook

12. useRef 로 컴포넌트 안의 변수 만들기 컴포넌트에서 특정 DOM 을 선택해야 할 때, ref 를 사용해야 한다고 배웠었습니다. 그리고, 함수형 컴포넌트에서 이를 설정 할 때 useRef 를 사용하여 설정한

react.vlpt.us

useRef 로 관리하는 변수는 값이 바뀐다고 해서 컴포넌트가 리렌더링되지 않습니다. 리액트 컴포넌트에서의 상태는 상태를 바꾸는 함수를 호출하고 나서 그 다음 렌더링 이후로 업데이트 된 상태를 조회 할 수 있는 반면, useRef 로 관리하고 있는 변수는 설정 후 바로 조회 할 수 있습니다.

 

 

나는 일단

리액트도 실행될때 전체 컴포넌트들 다 렌더링돼서

부분만 렌더링해주려고 useRef 쓴다라고 이해했지

 

https://www.daleseo.com/react-hooks-use-ref/

 

React Hooks: useRef 사용법

Engineering Blog by Dale Seo

www.daleseo.com

useRef 사용하기

useRef 함수는 current 속성을 가지고 있는 객체를 반환하는데, 인자로 넘어온 초기값을 current 속성에 할당합니다. 이 current 속성은 값을 변경해도 상태를 변경할 때 처럼 React 컴포넌트가 다시 랜더링되지 않습니다. React 컴포넌트가 다시 랜더링될 때도 마찬가지로 이 current 속성의 값이 유실되지 않습니다.

useRef 훅 함수가 반환하는 객체의 이러한 독특한 성질을 이용하여 startCounter()와 stopCounter() 함수를 구현해보았습니다.

728x90
728x90

https://homzzang.com/b/js-1381

https://velog.io/@kwonh/React-react-router-dom-%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0

 

[React] react-router-dom 시작하기

안녕하세요이번 포스팅은 SPA앱을 만들 때 많이 사용되는 react-router-dom패키지에 대해 알아보겠습니다.create-react-app을 이용해 진행했습니다.react-router - 웹&앱react-router-dom - 웹react-router-native

velog.io

완료되면 App.js에서 import문에 다음을 추가합니다.

 

import React ,{Component} from 'react';

import { BrowserRouter,Route, Link,Switch } from "react-router-dom";

import된 BrowserRouter, Route, Link, Switch는

  • BrowserRouter - history API를 사용해 URL과 UI를 동기화하는 라우터입니다.
  • Route - 컴포넌트의 속성에 설정된 URL과 현재 경로가 일치하면 해당하는 컴포넌트, 함수를 렌더링한다.
  • Link - 'a'태그와 비슷합니다. to속성에 설정된 링크로 이동합니다. 기록이 history스택에 저장됩니다.
  • Switch - 자식 컴포넌트 Route또는 Redirect중 매치되는 첫 번째 요소를 렌더링합니다. Switch를 사용하면 BrowserRouter만 사용할 때와 다르게 하나의 매칭되는 요소만 렌더링한다는 점을 보장해줍니다.
    사용하지 않을 경우 매칭되는 모두를 렌더링합니다.
728x90
728x90

const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', timeZoneName: 'long' };

 

이게 중요한거같아

const event = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));

const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };

console.log(event.toLocaleDateString('de-DE', options));
// expected output: Donnerstag, 20. Dezember 2012

console.log(event.toLocaleDateString('ar-EG', options));
// expected output: الخميس، ٢٠ ديسمبر، ٢٠١٢

console.log(event.toLocaleDateString(undefined, options));
// expected output: Thursday, December 20, 2012 (varies according to default locale)

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString

 

Date.prototype.toLocaleDateString() - JavaScript | MDN

The toLocaleDateString() method returns a string with a language sensitive representation of the date portion of this date. The new locales and options arguments let applications specify the language whose formatting conventions should be used and allow to

developer.mozilla.org

 

https://ichi.pro/ko/tolocaledatestring-eul-sayonghayeo-javascript-naljja-hyeongsig-jijeong-45462506610720

 

toLocaleDateString을 사용하여 JavaScript 날짜 형식 지정

도우미 기능이 없으면 날짜 형식을 지정하는 것이 어렵습니다. 로케일에 민감한 방식으로 날짜 형식을 지정해야하는 것은 훨씬 더 고통 스럽습니다.

ichi.pro

 

 

 

참고로 투두리스트 만들 때 시간 적용한 코드는 이와 같음

new Date(); 생성자로 불러와서 쓰는듯

728x90

'웹 공부' 카테고리의 다른 글

객체지향 절차지향  (0) 2021.11.29
비주얼스튜디오 폴더 사용, 깃, 리액트 깔기 팁  (0) 2021.11.03
배열과 객체 차이  (0) 2021.10.27
디버깅/npm/path  (0) 2021.09.24
java 반복문 for문으로 별찍기/ while문  (0) 2021.08.18
728x90

https://opentogether.tistory.com/97

 

배열과 객체의 개념과 차이 (Array vs Object)

#1 배열과 객체의 정의 배열의 선언방법 let arr = []; 1 2 3 let arr = [];          // 빈 배열 선언 arr = [1, 3, 5, 7, 9]; // 배열에 값 할당 console.log(arr);      // ..

opentogether.tistory.com

배열(array)

JSON에서 배열(array)이란 여러 개의 데이터가 순서를 가지고 나열된 집합을 의미합니다.

이러한 JSON 배열은 대괄호([])로 둘러싸여 있습니다.

 

JSON 배열은 쉼표(,)를 사용하여 여러 개의 데이터를 나열할 수 있습니다.

이 방식은 객체에서 프로퍼티를 나열하는 것과 비슷하지만, 배열은 데이터의 값만을 나열한다는 차이가 있습니다.

http://tcpschool.com/json/json_datatype_array

728x90

+ Recent posts