expo-zustand-styled-components starter kit
This starter kit features Expo, combined with Zustand, and Styled-components
Overview
Tech Stack
Included Tooling
- Jest - Test runner
- TypeScript - Type checking
- ESLint - Code linting
- Prettier - Code formatting
Example Components
- Home page
src/screens/Home/Home.tsxwith a counter component and a button to navigate to the about page. - About page
src/screens/About/About.tsxwith a button to navigate back to the home page. - An example Button component
src/components/Button/Button.tsx
In this starters/expo-zustand-styled-components/src directory you will find the screens and components directories. The screens directory contains the following files:
-
Home/index.ts
-
Home/Home.tsx
-
Home/Home.styles.tsx
-
Home/useCounter.ts
-
About/index.ts
-
About/About.tsx
-
About/About.styles.tsx
The Button directory contains the following files:
- Button.styles.tsx
- Button.test.tsx
- Button.tsx
- index.ts
Installation
CLI (Recommended)
npm create @this-dot/starter -- --kit expo-zustand-styled-components
or
yarn create @this-dot/starter --kit expo-zustand-styled-components
- Follow the prompts to select the
expo-zustand-styled-componentsstarter kit and name your new project. cdinto your project directory and runnpm install.- Run
npm run startto start the development server. - Press
ito open the iOS simulator orato open the Android simulator. - Press
wto open the web browser. - Open your browser to
http://localhost:19006to see the included example code running.
Manual
git clone https://github.com/thisdot/starter.dev.git
- Copy and rename the
starters/expo-zustand-styled-componentsdirectory to the name of your new project. cdinto your project directory and runnpm install.- Run
npm run devto start the development server. - Open your browser to
http://localhost:3000to see the included example code running.
Commands
npm run start- Starts the development server.npm run test- Runs the unit tests.npm run ios- Runs the app in the iOS simulator.npm run android- Runs the app in the Android simulator.npm run web- Runs the app in the web browser.
Kit Organization / Architecture
The demo components included in the starter.kit are co-located with the tests. If you want to follow this pattern, take a look at our GitHub demo implementation below. The demo implementation is done with the same structure but includes things like tests, styles, and view components that are modeled after an MVC type architecture. Using this structure makes it easy to find all the code and functionality related to a specific component.
Demo Implementation
The demo application re-implements some of GitHub’s pages and functionality. It uses the OAuth credentials in GitHub to authenticate users with their GitHub accounts and uses RxJS to fetch data from the GitHub API. Check out the link above to learn more or check out the demo!