yarn add eslint eslint-config-airbnb eslint-config-prettier eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react
{
import * as React from 'react'; | |
import { inject, observer } from 'mobx-react'; | |
import Header from 'components/base/Header'; | |
import RootStore from 'stores'; | |
interface HeaderContainerProps {} | |
interface InjectedProps extends HeaderContainerProps { | |
mode: string; |
{ | |
"Object Destructure from this.props": { | |
"prefix": "odprops", | |
"body": [ | |
"const { ${1:value} } = this.props;" | |
], | |
"description": "" | |
}, | |
"Re-export": { | |
"prefix": "rexp", |
{ | |
"Object Destructure from this.props": { | |
"prefix": "odprops", | |
"body": ["const { ${1:value} } = this.props;"], | |
"description": "" | |
}, | |
"Re-export": { | |
"prefix": "rexp", | |
"body": [ | |
"export { default as ${1:MyComponent} } from './${1:MyComponent}';" |
import { | |
createAction, | |
createStandardAction, | |
ActionType, | |
} from 'typesafe-actions'; | |
import { createReducer } from '../utils'; | |
const SET_KEYWORD = 'header/SET_KEYWORD'; | |
export const setKeyword = createStandardAction(SET_KEYWORD)<string>(); |
const nodeExternals = require('webpack-node-externals'); | |
const webpack = require('webpack'); | |
const getClientEnvironment = require('./env'); | |
const paths = require('./paths'); | |
const cssRegex = /\.css$/; | |
const cssModuleRegex = /\.module\.css$/; | |
const sassRegex = /\.(scss|sass)$/; | |
const sassModuleRegex = /\.module\.(scss|sass)$/; |
// 이 함수는 파라미터로 액션의 타입 (예: GET_USER) 과 Promise 를 만들어주는 함수를 받아옵니다. | |
export function createAsyncDispatcher(type, promiseFn) { | |
// 성공, 실패에 대한 액션 타입 문자열을 준비합니다. | |
const SUCCESS = `${type}_SUCCESS`; | |
const ERROR = `${type}_ERROR`; | |
// 새로운 함수를 만듭니다. | |
// ...rest 를 사용하여 나머지 파라미터를 rest 배열에 담습니다. | |
async function actionHandler(dispatch, ...rest) { | |
dispatch({ type }); // 요청 시작됨 |
import React, { createContext, useContext } from 'react'; | |
const MyContext = createContext('defaultValue'); | |
function Child() { | |
const text = useContext(MyContext); | |
return <div>안녕하세요? {text}</div> | |
} | |
function Parent() { |