![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbojGsV%2FbtqVdNLpXNm%2FQy3lK12J7XNVFj6Hos5DOk%2Fimg.png)
html2canvas + ์ด๋ฏธ์ง ํธ์คํ *์์ ๋ React Hook ํ๊ฒฝ์์ ์งํ๋์์ต๋๋ค. ๊ฒฐ๊ณผ table์ ์ด๋ฏธ์ง๋ก ๋ง๋ค์ด ๊ณต์ ํด์ผํ๋ ์๊ตฌ์ฌํญ์ด ์์๋ค. ์๊ตฌ์ฌํญ์ ์ํํ๊ธฐ ์ํด์๋ ๋ค์๊ณผ ๊ฐ์ ๊ณผ์ ๋ฅผ ์์ฐจ์ ์ผ๋ก ํด๋ด์ผํ๋ค. html table์ ์ด๋ฏธ์ง๋ก ๋ง๋ค๊ธฐ ๋ง๋ค์ด์ง ์ด๋ฏธ์ง๋ฅผ ํธ์คํ ํ๊ธฐ ํธ์คํ ๋ ์ด๋ฏธ์ง๋ฅผ ์นด์นด์คํก api๋ฅผ ์ด์ฉํ์ฌ ๊ณต์ ํ๊ธฐ ์ฐจ๋ก๋๋ก ํด๋ณด์. html table์ ์ด๋ฏธ์ง๋ก ๋ง๋ค๊ธฐ DOM์์๋ฅผ ์ด๋ฏธ์ง๋ก ๋ง๋ค ๋, html2canvas๋ผ๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ์ฃผ๋ก ์ฐ์ธ๋ค. import html2canvas from 'html2canvas'; const copyDOM = async () => { window.scrollTo(0, 0); let url = ""; await html2canvas(..
module.exports = { 'parser': '@typescript-eslint/parser', 'plugins': ['@typescript-eslint'], 'env': { 'commonjs': true, 'browser': true, 'es2021': true, 'node' : true }, 'extends': [ 'airbnb', 'airbnb/hooks', 'plugin:@typescript-eslint/recommended' ], 'parserOptions': { 'project': './tsconfig.json', 'ecmaFeatures': { 'jsx': true, }, 'ecmaVersion': 12, 'sourceType': 'module', }, 'rules': { 'inden..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2F31a4Q%2FbtqGexb73tt%2FPYhCJr7if7Kiw5NVbG8kCk%2Fimg.png)
React Hook React ๊ณต์์ฌ์ดํธ ์ฐธ์กฐ : https://ko.reactjs.org/docs/hooks-intro.html Hook ์๊ฐ Hook์ ์ด๋ค ๊ฒ์ด๊ณ ์ ๋์ค๊ฒ ๋์์๊น? Hook์ด๋? ์ฐ์ Hook์ React 16.8 ๋ฒ์ ์ ์๋ก ์ถ๊ฐ๋ ์ต์ ๊ธฐ๋ฅ์ผ๋ก, ํด๋์คํ ์ปดํฌ๋ํธ์ ๋จ์ ์ ๊ทน๋ณตํ๊ณ ์ ๋์จ ํจ์ํ ์ปดํฌ๋ํธ์ ๋ํ ๊ธฐ๋ฅ์ด๋ค. Hook์ ํจ์ํ ์ปดํฌ๋ํธ๋ก๋ ํด๋์คํ ์ปดํฌ๋ํธ์ ๊ธฐ๋ฅ์ ์ฌ์ฉํ ์ ์๋๋ก ํด์ค๋ค. ํจ์ํ ์ปดํฌ๋ํธ๋? // ํด๋์คํ ์ปดํฌ๋ํธ import React, { Component } from 'react'; class App extends Component { render(){ return ( //jsx ); } } export default App; // ํจ์ํ..
Comment