Frontend/React Native
Install $ yarn add react-native-view-shot Import import ViewShot from 'react-native-view-shot'; Code import ViewShot from 'react-native-view-shot'; function App() { const ref = useRef(); const captureScreen = () => { ref.current.capture().then((uri) => { console.log('capture complete...', uri); }); }; return ( // ํ๋ฉด ์บก์ฒ๋ ๋ถ๋ถ์ ViewShot ์ปดํฌ๋ํธ๋ก ๊ฐ์ธ์ค๋คโโ ํ๋ฉด ์บก์ฒ ); } ๐ก useRef useRef๋ ํน์ ์ปดํฌ๋ํธ๋ฅผ ์ ํํ ๋ ์ฌ์ฉํ๋ ho..
Frontend/React Native
์ปค๋ฎค๋ํฐ ์์ธํ์ด์ง๋ฅผ ๋ง๋๋ ๊ณผ์ ์์ TextInput์ฐฝ์ด ์คํฌ๋ฆฐ์ ๋งจ ๋ฐ์ ์์นํ๋๋ก ํ์๋ค. ์ฑ์ผ๋ก ๊ฐ๋ฐ์ ์ฒ์ํด๋ณด๋ ์์์น ๋ชปํ ๋ฌธ์ ๊ฐ ์๊ฒผ๋ค. ํค๋ณด๋๋ฅผ ๋์ฐ๋ฉด TextInput์ฐฝ์ ๋ฎ์ด ๋ฌด์์ ์
๋ ฅํ๋์ง ๋ณผ ์๊ฐ ์๊ฒ ๋ ๊ฒ์ด๋ค. ํค๋ณด๋๊ฐ TextInput์ฐฝ์ ์๊ฐ๋ฆฌ๋๋ก ํ๊ณ ํฌ์ปค์ฑ์ด ๋๋๋ก ํด๋ณด์โโ 1๏ธโฃ react-native-keyboard-aware-scroll-view ๋ชจ๋ ์ค์น npm i react-native-keyboard-aware-scroll-view --save 2๏ธโฃ import๋ฌธ import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; 3๏ธโฃ ๋ณธ๋ฌธ ๋ด์ฉ์ KeyboardAwareSc..
Frontend/React Native
๋ฌธ์ ๊ธฐ์กด์ JavaScript์์๋ toLocaleString() ๋ฉ์๋๋ฅผ ์ฌ์ฉํ๋ฉด ๊ฐ๊ฒฉ์ ์ฒ ๋จ์๋ง๋ค ์ผํ๋ฅผ ์ฝ๊ฒ ๋ฃ์ ์ ์๋ค. ํ์ง๋ง ์๋๋ก์ด๋์์๋ JavaScript์ ์ต์ ๋ฒ์ ์ ์ง์ํด์ฃผ์ง ์์ผ๋ฏ๋ก ์ง์ function์ ๋ง๋ค๊ฑฐ๋ ๋ณํํด์ฃผ๋ ์์
์ด ํ์ํ๋ค. ์ฌ์ฉ ์ฝ๋ (๋ณํ์ ์ํ๋ ์ซ์).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); Object.prototype.toString() ๋ฌธ์์ด์ ๋ฐํํ๋ object์ ๋ํ์ ์ธ ๋ฐฉ๋ฒ ์ ๊ท์์ ์ฌ์ฉํ๊ธฐ ์ํด ๊ทธ๋ฆฌ๊ณ ๊ตฌ๋ถ์๊ฐ ํฌํจ๋ ์๋ก์ด ๋ฌธ์์ด์ ์ป๊ธฐ ์ํด ์ฌ์ฉ 1๏ธโฃ ์ ๊ท์ ์์ฑ ๋ฐฉ๋ฒ 2๊ฐ์ง ์ ๊ท์ ๋ฆฌํฐ๋ด(/๋ก ๊ฐ์ธ๋ ํจํด)์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ ๐ RegExp ๊ฐ์ฒด์ ์์ฑ์ ํจ์๋ฅผ ํธ์ถํ๋ ๋ฐฉ๋ฒ 2๏ธโฃ ..
Frontend/React Native
Expo CLI ์ค์น $ npm install --global expo-cli Expo Go ์ฑ ์ค์น Android Play Store https://play.google.com/store/apps/details?id=host.exp.exponent Expo ํ๋ก์ ํธ ์์ฑ $ expo init ์ฑ์ด๋ฆ ๐ Choose a template → blank - a minimal app as clean as an empty canvas ์ ํ Expo ๋ก๊ทธ์ธ(VS code ํฐ๋ฏธ๋) expo login Expo ํ๋ก์ ํธ ์คํ(VS code ํฐ๋ฏธ๋) expo start --tunnel