Development61 [React] port ๋ฒํธ ๋ณ๊ฒฝํ๊ธฐ ๋ฐฉ๋ฒ1. ๋ช ๋ น์ด๋ก ์คํ (1ํ์ฑ) PORT=[์ซ์] npm run start ๋ฐฉ๋ฒ2. package.json ์์ window ... "scripts": { "start": "set PORT=3002 && react-scripts start", } ... ๋ฐฉ๋ฒ3. ํ๋ก์ ํธ๋ช /node_modules/react-scripts/scripts/start.js ์์ ํ๊ธฐ const DEFAULT_PORT = parseInt(process.env.PORT, 10) || 3002;// ์์ const HOST = process.env.HOST || '0.0.0.0'; ๋ฐฉ๋ฒ4. .env ํ์ผ ์์ฑํ๊ณ port ์ค์ ํ๊ธฐ ํ๋ก์ ํธ๋ช /.env PORT=3002 ๋ช ๋ น์ด๋ก ์คํ npm run start Reference [#. .. 2023. 1. 23. [axios] axios 1 axios๋? ๋ธ๋ผ์ฐ์ ์ node.js์์ ์ฌ์ฉํ ์ ์๋ Promise ๊ธฐ๋ฐ HTTP ํด๋ผ์ด์ธํธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ํน์ง ๋ธ๋ผ์ฐ์ ๋ฅผ ์ํด XMLHttpRequests ์์ฑ node.js๋ฅผ ์ํด http ์์ฒญ ์์ฑ Promise API๋ฅผ ์ง์ ์์ฒญ ๋ฐ ์๋ต ์ธํฐ์ ํธ ์์ฒญ ๋ฐ ์๋ต ๋ฐ์ดํฐ ๋ณํ ์์ฒญ ์ทจ์ JSON ๋ฐ์ดํฐ ์๋ ๋ณํ XSRF๋ฅผ ๋ง๊ธฐ์ํ ํด๋ผ์ด์ธํธ ์ฌ์ด๋ ์ง์ ์ค์น npm install axios ์ฌ์ฉ ์์ // POST ์์ฒญ ์ ์ก axios({ method: 'post', url: '/user/12345', data: { firstName: 'Fred', lastName: 'Flintstone' } }); // node.js์์ GET ์์ฒญ์ผ๋ก ์๊ฒฉ ์ด๋ฏธ์ง ๊ฐ์ ธ์ค๊ธฐ axios({ method: 'ge.. 2023. 1. 21. [npm].npmrc npmrc ํ์ผ์ด๋? ๐ก npm์์ ์ค์ ์ ์ ์ฅํด๋๋ ํ์ผ ๋ด์ฅ(builtin), ์ ์ญ(global), ์ฌ์ฉ์(user), ํ๋ก์ ํธ(project) 4๊ฐ์ง ๋ฒ์์ npmrc ํ์ผ์ด ์กด์ฌ ๋ด์ฅ ์ค์ npm์ด ์ค์น๋ ๊ฒฝ๋ก์ ์๋ npmrc ํ์ผ์ ๋ช ์๋จ ๋ชจ๋ ๊ธฐ๋ณธ ์ค์ ์ ๋ด๊ณ ์์ ์ ์ญ ์ค์ ๊ฐ์ ์ปดํจํฐ๋ฅผ ์ฌ์ฉํ๋ ๋ค๋ฅธ ์ฌ์ฉ์์ ๋ชจ๋ ํ๋ก์ ํธ์ ๊ด๋ฒ์ํ๊ฒ ์ ์ฉ ์ผ๋ฐ์ ์ผ๋ก ์ ๊ฑด๋ค์ง ์์ ๋ณดํต, ์ฌ์ฉ์ ๋ฒ์์ ํ๋ก์ ํธ ๋ฒ์์์ npmrc ํ์ผ์ ๋ค๋ฃธ ⇒ํ์ผ ๋ช ์์ . ์ ๋ถ์ฌ ์จ๊ธด ํ์ผ๋ก ์ฌ์ฉ ์ฌ์ฉ์ ๋ฒ์ ์ด์ ์ฒด์ ์ ์ฌ์ฉ์ ํ(home) ๋๋ ํ ๋ฆฌ์ ์์น ํ๋ก์ ํธ ๋ฒ์ ํ๋ก์ ํธ ์ต์์(root) ๋๋ ํ ๋ฆฌ์ ์์น ํ๋ก์ ํธ ๋ฒ์๊ฐ ์ฌ์ฉ์ ๋ฒ์๋ณด๋ค ์ข์ ⇒ ํ๋ก์ ํธ ์ค์ ์ด ์ฌ์ฉ์ ์ค์ ๋ณด๋ค ์ฐ์ ์ npm confi.. 2023. 1. 19. [React] React Hook API Hook ๊ฐ์ Hook์ class๋ฅผ ์์ฑํ์ง ์๊ณ ๋ state์ ๋ค๋ฅธ React์ ๋ค๋ฅธ ๊ธฐ๋ฅ๋ค์ ์ฌ์ฉํ ์ ์๊ฒ ํด์ค Hook์ ๊ณ์ธต์ ๋ณํ ์์ด ์ํ ๊ด๋ จ ๋ก์ง์ ์ฌ์ฌ์ฉํ ์ ์๋๋ก ๋์์ค ๊ธฐ๋ณธ Hook useState useEffect useContext ์ถ๊ฐ Hooks useReducer useCallback useMemo useRef useImperativeHandle useLayoutEffect useDebugValue useDeferredValue useTransition useId library hooks useSyncExternalStore useInsertionEffect ๐State Hook ์ฌ๋ฌ state ๋ณ์ ์ ์ธํ๊ธฐ ํ๋์ ์ปดํฌ๋ํธ ๋ด์์ state hook์ ์ฌ๋ฌ๊ฐ ์ฌ์ฉํ ์ .. 2023. 1. 18. [React] React Life Cycle ; ๋ฆฌ์กํธ ์๋ช ์ฃผ๊ธฐ React๋? javascript ๋ผ์ด๋ธ๋ฌ๋ฆฌ React ํ์ผ๋ค์ ์ญํ index.js src ํด๋์ ํฌํจ ๋ฉ์ธ ํ๋ก๊ทธ๋จ HTML ํ ํ๋ฆฟ ๋ฐ JavaScript์ ์ปดํฌ๋ํธ๋ฅผ ์กฐํฉํ๊ณ ๋ ๋๋งํด ์ค์ ํ์ App.js src ํด๋์ ํฌํจ ์ปดํฌ๋ํธ๋ฅผ ์ ์ํ๋ ํ๋ก๊ทธ๋จ ์ค์ ๋ก ํ๋ฉด์ ํ์๋๋ ๋ด์ฉ๋ฑ์ด ์ ์ index.html public ํด๋์ ์์ ๋ฉ์ธ ํ๋ก๊ทธ๋จ์ธ index.js์ ๋์๋๋ ๊ฒ HTML ํ ํ๋ฆฟ ํ์ผ ์ง์ ํ์๋๋ ๊ฒ์ ์๋๊ณ , index.js์ ์ํด ์ผ์ด๋ ๋ ๋๋ง ๊ฒฐ๊ณผ๊ฐ ํ์๋จ React Life Cycle React lifecycle ์ฉ์ด ์ฉ์ด ์ค๋ช ~ will ์ด๋ค ์์ ์ ์ํํ๊ธฐ ์ ์ ์คํ๋๋ ๋ฉ์๋์ ๊ด๋ จ๋ ์ฉ์ด ~ did ์ด๋ค ์์ ์ ์ํํ ์ดํ์ ์คํ๋๋ ๋ฉ์๋์ ๊ด๋ จ๋ ์ฉ์ด moun.. 2023. 1. 14. [Electron] Electron + React ์ฐ๋ํ๊ธฐ 1. React์ electron ์ ์ฉํ๊ธฐ https://2ssue.github.io/programming/electron-react/ #create-react-appํ electron ์ง์ด๋ฃ๊ธฐ npm init npm install create-react-app --save npx create-react-app {project_name} cd {project_name} npm install electron --save-dev ๋๋ ํ ๋ฆฌ ๊ตฌ์กฐ {project_name} โโโ public # ์ ์ ํ์ผ. react๋ฅผ ์ฌ์ฉํ๊ธฐ ๋๋ฌธ์ ํน๋ณํ ๋ณ๊ฒฝํ ๋ด์ฉ์ ์๋ค. โโโ src # javascript ํ์ผ. react routing, electron๋ก๋ฉ ๋ฑ์ ์์ ์ ์งํ. โ โโโ App.js โ โโโ in.. 2023. 1. 13. [Electron]Electron-forge Publishing a GitHub release Electorn-Forge electron forge๋ publisher ํ๋ฌ๊ทธ์ธ Github access token ์์ฑํ๊ธฐ electorn forge๋ github permission ์์ด ์ด๋ค repository์๋ publish ํ ์ ์์ Forge์ github releases ํ๊ฐ๋ฅผ ์ํด authenticated token์ด ํ์ํจ ๊ฐ์ฅ ์ฌ์ด ๋ฐฉ๋ฒ์ public_repo์ ํจ๊ป PAT๋ฅผ ์์ฑํด public repo์ ์ ๊ทผํด ์ธ ์ ์๊ฒ ํจ ๋ฐ๊ธ ๋ฐ์ ๋น๋ฐ๋ก ์ ์ง๋์ด์ผ๋ง ํจ! forge์์ github publisher ์ธํ ํ๊ธฐ ๋จผ์ forge์ github publisher ์ค์น npm install --save-dev @electron-fo.. 2023. 1. 12. [Electron]Electron Electron ์ด๋? ๐ก - JavaScript, HTML ๋ฐ CSS๋ฅผ ์ฌ์ฉํ์ฌ ๋ฐ์คํฌํ ์ ํ๋ฆฌ์ผ์ด์ ์ ๊ตฌ์ถํ๊ธฐ ์ํ ํ๋ ์์ํฌ Chromium ๊ณผ Node.js ๋ฅผ ๋ฐ์ด๋๋ฆฌ์ ๋ด์ฅ Electron์ ์ฌ์ฉํ๋ฉด ํ๋์ JavaScript ์ฝ๋ ๋ฒ ์ด์ค๋ฅผ ์ ์งํ๊ณ Windows, macOS ๋ฐ Linux์์ ์๋ํ๋ ํฌ๋ก์ค ํ๋ซํผ ์ฑ์ ๋ง๋ค ์ ์์ ํต์ฌ ๊ตฌ์ฑ ์์ ๐ก ํ๋ก ํธ์๋ : ํฌ๋ก๋ฏธ์ ๋ฐฑ์๋ : ๋ ธ๋JS ํฌ๋ก๋ฏธ์ ๋ ๋๋ง ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๋ ธ๋JS์ ๊ฒฐํฉ - V8์ ๊ณต์ โณ์คํ์์ค ์น๋ธ๋ผ์ฐ์ ํฌ๋ก๋ฏธ์(Chromium) โณ๋ธ๋ผ์ฐ์ ๋ฐ์์ ์๋ฐ์คํฌ๋ฆฝํธ ์ฝ๋๋ฅผ ์คํํ๋ ๋ฐํ์ ํ๊ฒฝ์ธ ๋ ธ๋JS โณ์คํ์์ค ์๋ฐ์คํฌ๋ฆฝํธ ์์ง V8 ํ์ฉ ์ฌ๋ก Atom Editor VScode Slack ์ฅ์ ๋ฎ์ ์ง์ ์ฅ๋ฒฝ JavaSc.. 2023. 1. 11. [React-Native] KeyboardAwareScrollView KeyboardAwareScrollView ํค๋ณด๋๋ฅผ ์ฐ๋ค ๋ณด๋ ์ค์ ๋ชจ๋ฐ์ผ ๊ธฐ๊ธฐ์์ ํค๋ณด๋๊ฐ ์ฌ๋ผ์์ ๋์ ์ํฉ์ ์ธ์งํ์ง ๋ชปํจ. ํด๊ฒฐ๋ฐฉ๋ฒ1 ๋ฆฌ์กํธ ๋ค์ดํฐ๋ธ์์ ์ ๊ณตํ๋ [KeyboardAvoidingView](https://facebook.github.io/react-native/docs/keyboardavoidingview#docsNav) API๋ฅผ ์ ์ฉ -> ํ์ง๋ง `ScrollView` ๋ด์์ ์๋ํ์ง ์๋ ๋จ์ ํด๊ฒฐ๋ฐฉ๋ฒ 2 [react native keyboard aware scroll view](https://github.com/APSL/react-native-keyboard-aware-scroll-view) Focus๋ InputForm์ ํค๋ณด๋๊ฐ ๊ฐ๋ฆฌ์ง ์๊ฒ ํจ ์๋์๋ InputForm์ .. 2022. 11. 4. [React-Native] Button React-Native์ Button์ styling์ด ์ ํ์ Button์ ์ฌ์ฉํ์ฌ Color๋ฅผ ์ง์ ํ ๋ ๊ณต์๋ฌธ์์ props๋ฅผ ๋ณด๋ฉด Color๋ฐ์ ์์ผ๋ฉฐ ๋ํ ๋ฒํผ ์์ ๊ฒฝ์ฐ title={} ํ์์ผ๋ก ๋ณด๋ด์ฃผ๊ธฐ ๋๋ฌธ์ ๊ธ์จ์ฒด Color๋ ์ง์ ๋ถ๊ฐ React-Native Button style not work React-Native Button style not work Import_this import {AppRegistry, Text, View, Button, StyleSheet} from 'react-native'; This my React Button code But style not working Hare ... 2022. 10. 30. ์ด์ 1 2 3 4 5 6 7 ๋ค์