본문 바로가기

Top

New Features in ES6 Fat Arrow Functionconst getNumber = () => 1; const getArray = () => [1, 2, 3]; const getObject = () => ({a: 1, b: 2, c: 3}); const withParam = (payload) => payload;Object Manipulationconst {a, b} = result; const {data: {a, b}} = result; const firstObj = {a, b}; (Same as {a: a, b:b}) const secondObj = {c, d}; const mergeObj = { ...firstObj, ...secondObj};Async Function(Promise)const isTrue = (pay.. 더보기
Create Expo + ReactNative + Typescript Manually I can make Expo + ReactNative + Typescript via below script easily.]$ create-react-native-app {{APP_NAME}} --scripts-version=react-native-scripts-tsBut, Sometimes I need setup typescript manually.Here the solution !]$ yarn add -D typescript tslib @types/react @types/react-native @types/expoWrite App.js file below..import AppContainer from "./src/AppContainer"; export default AppContainer;Make sr.. 더보기
Create ReactNative + Typescript App project ]$ yarn global add create-react-native-app]$ create-react-native-app {{APP_NAME}} --scripts-version=react-native-scripts-tsReactJS 웹프로젝트 생성해주듯이 Native 용 프로그램인 create-react-native-app을 설치해준다. 이해 해당 cli를 이용하여 --scripts-version=react-native-scripts-ts 옵션을 줘서 프로젝트를 생성해준다.생성해준 후 기존 expo 환경에서의 개발이 편하다면 scripts들에 명령들을 생성해주어 기존 CRNA를 통해 작업했을 때와 동일하게 작업이 가능하다. "scripts": { "start": "expo start", "eject":.. 더보기