ignite - React Native의 boilerplate
React Native 프로젝트를 생성하는데 있어서 CLI를 이용하거나 expo를 이용하는 등 여러가지 선택지가 있을 수 있다.
다만, 여기에 더해서 mobx나 splash screen 등 추가적인 설정까지 해주는 boilerplate를 사용할 수도 있다.
가장 대표적인 React Native의 boilerplate인 ignite를 통해서 프로젝트를 생성해보았다.
Ignite
ignite를 통해서 생성된 프로젝트는 typescript, navigation, 상태관리, storage, 테스트 라이브러리, Rest Client 등이 이미 설치된 채로 생성된다.
미리 제공되는 라이브러리를 사용하면 되기에, 충돌이나 설정과 같은 골치아픈 일을 겪지 않을 수 있다.
초기 설정에서 demo를 지우지 않는다면, ignite에서 제공하는 데모 앱이 함께 설치된다.
# 기본 설정으로 프로젝트를 생성한다. PizzaApp이라는 폴더 내부에 프로젝트가 생성되며 기본 패키지 매니저는 yarn이다.
npx ignite-cli@latest new PizzaApp --yes
# 설정을 직접 선택한다. git 사용여부, 앱 패키지 이름, pnpm, yarn, npm 중 하나의 패키지 매니저를 선택할 수 있다.
npx ignite-cli@latest new PizzaApp
생성된 프로젝트는 expo 설정이 되어있다.
expo로 실행할 수도 있고, React Native CLI로 실행할 수도 있다.
app 폴더 내부에 components, screens, services, theme, utils, config, models, navigators, i18n 등 폴더 구조가 나뉘어져 있다.
components 내부에는 ignite에서 제공하는 UI 컴포넌트들이 있다.
이를 사용하여 좀 더 쉽게 예쁜 UI를 작성할 수 있다.
또한, app.tsx에 Provider 설정이 미리 되어있기에 설치된 라이브러리를 곧바로 사용할 수 있다.
i18n 설정이 되어있어 다국어 대응도 손쉽게 할 수 있다.
이외에도 patch-package, prettier, query-string, react-native-web 등이 기본적으로 설치된다.
https://github.com/infinitered/ignite
GitHub - infinitered/ignite: Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model ge
Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more! - GitHub - infinitered/ignite: Infinite Red's battle-tested React Nati...
github.com