build: 패키지 정리

main
Lim Jonguk 3 years ago
parent 874d26d56e
commit 8b072b9f29

@ -82,6 +82,12 @@ useEffect(() => {
useRef : 클래스로 치면 멤버변수 혹은 dom객체 처럼 특정한 '값'만 기억해야 할 때 useRef : 클래스로 치면 멤버변수 혹은 dom객체 처럼 특정한 '값'만 기억해야 할 때
useMemo : 복잡한 함수의 'retur값'을 기억해야 할 때 useMemo : 복잡한 함수의 'retur값'을 기억해야 할 때
``` ```
### typeof : primitive type string return vs instanceof
```js
'undefined' | 'boolean' | 'number' | 'string' | 'object' | 'function'
date-fns typeof 변수명
moment typeof 변수명 === 'object'
변수명 instanceof 클래스
```

@ -28,6 +28,7 @@
"chance": "^1.1.8", "chance": "^1.1.8",
"core-js": "^3", "core-js": "^3",
"csstype": "^3.0.10", "csstype": "^3.0.10",
"date-fns": "^2.28.0",
"draft-js": "^0.11.7", "draft-js": "^0.11.7",
"emoji-picker-react": "^3.5.1", "emoji-picker-react": "^3.5.1",
"formik": "^2.2.9", "formik": "^2.2.9",

@ -4,7 +4,6 @@ import _ from 'lodash';
import format from 'date-fns/format'; import format from 'date-fns/format';
import getYear from 'date-fns/getYear'; import getYear from 'date-fns/getYear';
// material-ui // material-ui
import { GridActionsCellItem } from '@mui/x-data-grid'; import { GridActionsCellItem } from '@mui/x-data-grid';
import { Divider, Grid, InputAdornment, MenuItem, OutlinedInput, Select } from '@mui/material'; import { Divider, Grid, InputAdornment, MenuItem, OutlinedInput, Select } from '@mui/material';
@ -26,13 +25,10 @@ import xitCmm from 'commons/XitCmm';
const ParkingReview = () => { const ParkingReview = () => {
const theme = useTheme(); const theme = useTheme();
const year = getYear(new Date()); const year = getYear(new Date());
console.log(`year = ${year}`); console.log(typeof year);
console.log(year instanceof Date); const years = _.range(year, year - 14, -1);
const toYear = Number(year);
console.log(`toYear = ${toYear}`);
const years = _.range(toYear, toYear - 14, -1);
const [selectedYear, setSelectedYear] = useState(toYear); const [selectedYear, setSelectedYear] = useState(year);
const [searchTxt, setSearchTxt] = useState(''); const [searchTxt, setSearchTxt] = useState('');
const [totalCount, setTotalCount] = useState(0); const [totalCount, setTotalCount] = useState(0);
@ -138,7 +134,7 @@ const ParkingReview = () => {
<Grid container spacing={1}> <Grid container spacing={1}>
<Grid item> <Grid item>
<MuiTooltip title="의견진술 심의 년도"> <MuiTooltip title="의견진술 심의 년도">
<Select id="reviewYear" name="reviewYear" defaultValue={toYear} onChange={(e) => setSelectedYear(e.target.value)}> <Select id="reviewYear" name="reviewYear" defaultValue={year} onChange={(e) => setSelectedYear(e.target.value)}>
{years.map((year, idx) => ( {years.map((year, idx) => (
<MenuItem key={idx} value={year}> <MenuItem key={idx} value={year}>
{year} {year}

Loading…
Cancel
Save