[Flutter] Provier 사용하기
Provider 생성 먼저 Provider 패키지를 pubspec.yaml 파일에 추가한다. 그 다음 전역 상태 클래스 파일을 생성한다. import 'package:flutter/material.dart'; class MyState with ChangeNotifier { int _count = 0; int get count =>...
Provider 생성 먼저 Provider 패키지를 pubspec.yaml 파일에 추가한다. 그 다음 전역 상태 클래스 파일을 생성한다. import 'package:flutter/material.dart'; class MyState with ChangeNotifier { int _count = 0; int get count =>...
원격 저장소 태그 가져오기 git fetch origin --tags 태그 목록 보기 git tag 태그로 이동 (브랜치 생성) git checkout tags/{태그명} 위 명령어는 태그명으로 브랜치를 생성한다. 원하는 이름으로 브랜치를 생성하려면 아래 명령어를 입력한다. git checkout tags/{태그명} -b {브랜치명}
모노레포란? Lerna 실행해보기 lerna example 브랜치에서 프로젝트를 clone한다. root 경로에서 yarn 명령어로 모듈을 인스톨한다. example 패키지 구조는 아래와 같으며, remixapp 패키지는 header, footer 패키지를 의존한다. packages/ ㄴheader ㄴfooter ㄴremixapp npx ...
앱 구조 void main() => runApp(MyApp()); class MyApp extends StatelessWidget {}; class MyHomePage extends StatefulWidget {}; class _MyHomePageState extends State<MyHomePage> {}; 앱 실행 부분 ...
파비콘이란? 웹페이지를 표시하도록 설정된 아이콘이다. manifest.json 파일과 <link> 메타 태그를 통해 설정할 수 있다. manifest 파일 설정하기 { "name": "My Website", "icons": [ { "src": "favicon-32x32.png", "sizes": "...
read only 속성의 객체를 writeable로 복사하는 방법 const readOnlyObj = { prop1: 'value1', prop2: 'value2' } // Object.assign()을 사용하여 객체 복사 const writableCopy = Object.assign({}, { ...readOnlyObj }) // wri...
const [startDate, setStartDate] = useState() const [endDate, setEndDate] = useState() const [title, setTitle] = useState('') const [description, setDescription] = useState('') const [location, setL...
configureStore() 스토어를 구성하는 함수 reducer, middleware 등의 정보를 전달한다. import { configureStore } from '@reduxjs/toolkit' import additionalMiddleware from 'additional-middleware' import logger from 'redu...
httpOnly httpOnly 옵션은 웹서버에서 Set-Cookie 헤더를 이용해 쿠키를 설정할 때 지정할 수 있다. 이 옵션은 자바스크립트 같은 클라이언트 측 스크립트가 쿠키를 사용할 수 없게 한다. httpOnly 옵션이 설정된 쿠키는 document.cookie로 쿠키 정보를 읽을 수 없기 때문에 쿠키를 보호할 수 있다. 자바스크립트로 ...
useTranslation 사용 import React from 'react' import { useTranslation } from 'react-i18next' export function MyComponent() { const { t } = useTranslation() t('total', { value: 10 }) } // ko....