### Start the development server Source: https://github.com/infinitered/ignite/blob/master/boilerplate/README.md Commands to initialize and start the development environment. ```bash pnpm run pnpm run start ``` -------------------------------- ### Create a new project Source: https://github.com/infinitered/ignite/blob/master/docs/cli/Ignite-CLI.md Starts the interactive prompt for generating a new Ignite project. ```bash npx ignite-cli new PizzaApp ``` -------------------------------- ### Generate screen with case formatting Source: https://github.com/infinitered/ignite/blob/master/docs/concept/Generators.md Examples of generating screens using different filename casing conventions. ```bash npx ignite-cli@latest g screen Episodes ``` ```bash npx ignite-cli@latest g screen log-in ``` -------------------------------- ### EmptyState Component Usage Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/components/EmptyState.md Full example demonstrating various props including presets, image configuration, and text styling. ```tsx ``` -------------------------------- ### Run the boilerplate application Source: https://github.com/infinitered/ignite/blob/master/docs/contributing/Tour-of-Ignite.md Commands to install dependencies and launch the boilerplate React Native app from the repository root. ```bash cd boilerplate pnpm install npx pod-install npx react-native run-ios npx react-native run-android ``` -------------------------------- ### Install EAS CLI Source: https://github.com/infinitered/ignite/blob/master/docs/QuickStart.md Install the EAS CLI globally using npm. This is required for building and publishing applications. ```bash npm install -g eas-cli ``` -------------------------------- ### Troubleshooting Ignite CLI Installation Source: https://github.com/infinitered/ignite/blob/master/docs/README.md Commands to help resolve common issues during Ignite CLI project initialization, such as uninstalling global versions or installing Xcode command line tools. ```bash npm uninstall -g ignite-cli ``` ```bash node --version ``` ```bash nvm install --lts ``` ```bash sudo xcode-select --install ``` ```bash sudo xcode-select -s /Applications/Xcode.app/Contents/Developer ``` ```bash open ./ios/.xcworkspace ``` ```bash npx ignite-cli@latest new --debug ``` -------------------------------- ### Create New React Native App with Ignite CLI Source: https://github.com/infinitered/ignite/blob/master/docs/README.md Use the Ignite CLI to generate a new React Native project. The `--yes` flag accepts all recommended defaults for a quick setup. ```bash npx ignite-cli@latest new PizzaApp ``` ```bash npx ignite-cli@latest new PizzaApp --yes ``` -------------------------------- ### Header Component Usage Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/components/Header.md Example of how to use the Header component with common props. ```APIDOC ## Header Component Usage ### Description This example demonstrates the basic usage of the Header component, including setting a title, navigation icons, and press handlers. ### Props - **titleTx** (string) - Optional - Translation key for the header title. - **title** (string) - Optional - Direct string for the header title. Overrides `titleTx` if both are present. - **leftIcon** (string) - Optional - Specifies the icon for the left navigation button (e.g., 'back', 'bullet', 'bug'). - **rightIcon** (string) - Optional - Specifies the icon for the right navigation button. - **onLeftPress** (function) - Optional - Callback function for when the left icon is pressed. - **onRightPress** (function) - Optional - Callback function for when the right icon is pressed. - **style** (StyleProp) - Optional - Style for the inner container of the header, useful for adjusting height. - **backgroundColor** (string) - Optional - Sets the background color of the header's outer container. - **titleStyle** (StyleProp) - Optional - Style for the header title text. - **titleContainerStyle** (StyleProp) - Optional - Style for the outer container of the header title. - **containerStyle** (StyleProp) - Optional - Style for the outer container of the header, useful for overriding insets on notched devices. ### Request Example ```tsx
navigation.goBack()} onRightPress={() => Alert.alert("pressed")} style={{ height: 60 }} backgroundColor="purple" titleStyle={{ color: "white" }} /> ``` ``` -------------------------------- ### Check Ignite CLI Installation Source: https://github.com/infinitered/ignite/blob/master/docs/cli/Troubleshooting.md Verify if Ignite CLI is installed globally on your system and retrieve its information. Use this to confirm installation or diagnose version conflicts. ```bash ignite --info ``` ```bash where ignite ``` -------------------------------- ### Setup ThemeProvider in App.tsx Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/theme/context.ts.md Wrap your application with ThemeProvider at the root to provide theme access to all child components. ```tsx import { ThemeProvider } from "@/theme/context" const App = () => { return {/* Your app components go here */} } ``` -------------------------------- ### Basic Header Usage Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/components/Header.md This example shows a basic Header with a title, left back icon, and right bullet icon. It demonstrates setting navigation actions and basic styling. ```tsx
navigation.goBack()} onRightPress={() => Alert.alert("pressed")} style={{ height: 60 }} backgroundColor="purple" titleStyle={{ color: "white" }} /> ``` -------------------------------- ### Setting Destination Directory with Front Matter Source: https://github.com/infinitered/ignite/blob/master/docs/concept/Generator-Templates.md This front matter example specifies a custom `destinationDir` for the template. Files generated from this template will be placed in `app/navigation` instead of the default directory. ```ejs --- destinationDir: app/navigation --- import { StackNavigator } from "react-navigation" // ... ``` -------------------------------- ### Create a New React Native App with Ignite CLI (Defaults) Source: https://github.com/infinitered/ignite/blob/master/README.md This command creates a new React Native project using Ignite CLI and accepts all recommended default settings, allowing you to start coding immediately. ```bash npx ignite-cli@latest new PizzaApp --yes ``` -------------------------------- ### Add Custom Reactotron Command Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/devtools/Devtools.md Use `reactotron.onCustomCommand` to add custom debugging tools to Reactotron. This example shows how to reset navigation state. ```typescript reactotron.onCustomCommand({ title: "Reset Navigation State", description: "Resets the navigation state", command: "resetNavigation", handler: () => { Reactotron.log("resetting navigation state") resetRoot({ index: 0, routes: [] }) }, }) ``` -------------------------------- ### Card Component with Reversed Preset Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/components/Card.md A basic Card component example using the 'reversed' preset for distinct styling. Requires heading, content, and footer. ```tsx ``` -------------------------------- ### Define Tab Stack Navigator Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/navigators/Navigation.md Example of nesting a stack navigator within a tab to manage multiple screens per tab. ```tsx const InboxStack = createNativeStackNavigator() function InboxStackScreen() { return ( ) } ``` -------------------------------- ### Clone Ignite Repository Source: https://github.com/infinitered/ignite/wiki/Intro-to-Contributing-to-Ignite Clone the Ignite repository to your local development environment. Ensure you have Node version 5.1 or later installed. ```shell git clone git@github.com:/ignite.git ``` -------------------------------- ### Patching a File with Front Matter Source: https://github.com/infinitered/ignite/blob/master/docs/concept/Generator-Templates.md This front matter example demonstrates how to use the `patch` option to append content to an existing file. It appends an export statement to `app/screens/index.ts`. ```ejs --- patch: path: "app/screens/index.ts" append: "export * from \"./<%= props.kebabCaseName %>/<%= props.kebabCaseName %>-screen\"\n" --- ``` -------------------------------- ### Rebuild Native Code Source: https://github.com/infinitered/ignite/blob/master/docs/concept/Upgrades.md If you've added native dependencies outside of the Expo ecosystem, run this command to rebuild your native code. '--clean' removes old builds, and '--no-install' skips automatic dependency installation. ```bash npx expo prebuild --clean --no-install ``` -------------------------------- ### Run the App Source: https://github.com/infinitered/ignite/blob/master/docs/QuickStart.md Navigate to the project directory and run the application on Android, iOS, or web. ```bash # first cd MyFirstApp # then one of the following pnpm run android pnpm run ios pnpm run web ``` -------------------------------- ### Display help information Source: https://github.com/infinitered/ignite/blob/master/docs/cli/Ignite-CLI.md List available commands and their descriptions. ```bash npx ignite-cli help ``` ```bash npx ignite-cli h ``` -------------------------------- ### Build the CLI Source: https://github.com/infinitered/ignite/blob/master/docs/contributing/Releasing-Ignite.md Clean and build the project from the root directory. ```bash pnpm run clean pnpm run build ``` -------------------------------- ### Initialize AppNavigator Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/navigators/Navigation.md Basic implementation of the primary application navigator with state management props. ```tsx ``` -------------------------------- ### Fetch data using the API service Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/services/api.ts.md Demonstrates how to import the singleton API instance and handle the response object. ```typescript import { api } from "@/services/api" // ... const response = await api.getEpisodes() if (response.kind === "ok") { // do something with response.episodes } else { console.error(`Error fetching episodes: ${JSON.stringify(response)}`) } ``` -------------------------------- ### Run Maestro Test Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/maestro.md Execute a specific Maestro test file from the command line. Ensure Maestro is set up in your environment. ```bash maestro test .maestro/MyTestFile.yaml ``` -------------------------------- ### Build Production Binaries Locally Source: https://github.com/infinitered/ignite/blob/master/docs/QuickStart.md Build production-ready binaries for Android (AAB) or iOS (IPA) locally using pnpm. ```bash # Running a local Android build pnpm run build:android:prod # or a local iOS build pnpm build:ios:prod ``` -------------------------------- ### Generate a component Source: https://github.com/infinitered/ignite/blob/master/docs/concept/Generators.md Creates a new component file structure. ```bash npx ignite-cli generate component MyAwesomeButton ``` -------------------------------- ### TextField with Translation Key Label Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/components/TextField.md Uses a translation key (`labelTx`) to set the label text, enabling internationalization. Requires `i18next` setup. ```tsx setInput(value)} labelTx="signup.name" /> ``` -------------------------------- ### Build for iOS targets Source: https://github.com/infinitered/ignite/blob/master/boilerplate/README.md Shortcuts for building the application for different iOS environments. ```bash pnpm run build:ios:sim # build for ios simulator pnpm run build:ios:device # build for ios device pnpm run build:ios:prod # build for ios device ``` -------------------------------- ### Add Google Font to Typography Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/theme/typography.ts.md Integrate Google Fonts by installing the package, importing the font styles, and adding them to `customFontsToLoad` and the `fonts` object in `app/theme/typography.ts`. ```bash npx expo install @expo-google-fonts/inter ``` ```typescript import { Inter_400Regular as interRegular, Inter_700Bold as interBold, } from "@expo-google-fonts/inter" export const customFontsToLoad = { spaceGroteskLight, spaceGroteskRegular, spaceGroteskMedium, spaceGroteskSemiBold, spaceGroteskBold, interRegular, interBold, } const fonts = { // ... inter: { normal: "interRegular", bold: "interBold", }, } ``` -------------------------------- ### EmptyState with Generic Preset Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/components/EmptyState.md Shows how to use the `generic` preset for a predefined EmptyState appearance. ```APIDOC ## EmptyState with Generic Preset ### Description This example demonstrates using the `preset="generic"` prop to apply a default configuration to the `EmptyState` component. ### Method N/A (Component Usage) ### Endpoint N/A (Component Usage) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```tsx ``` ### Response N/A (Component Usage) #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### TextField with Translation Key Helper Text Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/components/TextField.md Uses a translation key (`helperTx`) to set the helper text, enabling internationalization. Requires `i18next` setup. ```tsx setInput(value)} helperTx="signup.name" /> ``` -------------------------------- ### Create New Ignite Project Source: https://github.com/infinitered/ignite/blob/master/docs/Guide.md Use the Ignite CLI to create a new React Native project. It prompts for configuration or accepts defaults with the --yes flag. ```bash npx ignite-cli@latest new PizzaApp ``` -------------------------------- ### Publish beta release Source: https://github.com/infinitered/ignite/blob/master/docs/contributing/Releasing-Ignite.md Publish the package to npm with the next tag. ```bash npm publish --tag=next ``` -------------------------------- ### Uninstall Global Ignite CLI Source: https://github.com/infinitered/ignite/blob/master/docs/cli/Troubleshooting.md Remove previous global installations of the Ignite CLI to avoid version conflicts. Choose the command corresponding to your package manager. ```bash npm uninstall --global ignite-cli ``` ```bash yarn global remove ignite-cli ``` ```bash pnpm remove ignite-cli -g ``` -------------------------------- ### Generate a navigator Source: https://github.com/infinitered/ignite/blob/master/docs/concept/Generators.md Creates a React Navigation navigator in the app/navigators folder. ```bash npx ignite-cli generate navigator OrderPizza ``` -------------------------------- ### Hook up Navigation Theme Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/theme/Theming.md Pass the `navigationTheme` object obtained from `useAppTheme()` to the `NavigationContainer`'s `theme` prop to apply Ignite's theming to your react-navigation setup. ```tsx const { navigationTheme } = useAppTheme() return ``` -------------------------------- ### Spin up a new Expo-ready app Source: https://github.com/infinitered/ignite/blob/master/docs/expo/Expo-and-Ignite.md Use this command to create a new Ignite app. The `--yes` flag accepts all defaults. Navigate into the app directory and run the app on iOS or Android. ```bash npx ignite-cli new PizzaApp --yes cd PizzaApp pnpm run ios pnpm run android ``` -------------------------------- ### Card Component with Custom Heading Component Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/components/Card.md Replaces the default heading element with a custom component using the `HeadingComponent` prop. This example uses a `Button` component as the heading. ```tsx } content="Card Content" footer="Card Footer" /> ``` -------------------------------- ### List available generators Source: https://github.com/infinitered/ignite/blob/master/docs/concept/Generators.md Displays all generators currently available in the project. ```bash npx ignite-cli generate --list ``` -------------------------------- ### TextField Component Example Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/components/Components.md The TextField component provides a React Native TextInput with an integrated label. It supports internationalized labels and placeholders, custom input styling, and ref forwarding. ```tsx const [input, setInput] = useState("") const inputRef = useRef() ``` -------------------------------- ### Create a New Ignite App Source: https://github.com/infinitered/ignite/blob/master/docs/QuickStart.md Generate a new application using the Ignite CLI. The --yes flag accepts all defaults. ```bash npx ignite-cli new MyFirstApp --yes ``` -------------------------------- ### Generate a screen Source: https://github.com/infinitered/ignite/blob/master/docs/concept/Generators.md Creates a new screen with hooks enabled. ```bash npx ignite-cli generate screen Settings ``` -------------------------------- ### Define Header in Screen Config Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/components/Header.md Configure a specific header for a single screen within a navigator, overriding navigator-level settings. This example hides the default header and provides a custom one. ```tsx
}} /> ``` -------------------------------- ### Custom Filename with Front Matter Source: https://github.com/infinitered/ignite/blob/master/docs/concept/Generator-Templates.md Use front matter to specify a custom filename for the generated file. This example uses `props.camelCaseName` to set the filename to a camelCase version of the provided name. ```ejs --- filename: <%= props.camelCaseName %>.tsx --- ``` -------------------------------- ### Navigate to Ignite Directory Source: https://github.com/infinitered/ignite/wiki/Intro-to-Contributing-to-Ignite Change the current directory to the cloned Ignite repository. ```shell cd ignite ``` -------------------------------- ### Get Safe Area Insets Style Object Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/utils/useSafeAreaInsetsStyle.ts.md Obtain a style object for top and left safe area insets. The output will reflect the device's specific safe area values. ```tsx const $insetsStyle = useSafeAreaInsetsStyle(["top", "left"]) console.log($insetsStyle) // { paddingTop: 47, paddingStart: 0 } ``` -------------------------------- ### EmptyState Component Usage Source: https://github.com/infinitered/ignite/blob/master/docs/boilerplate/app/components/EmptyState.md Demonstrates the basic usage of the EmptyState component with essential props. ```APIDOC ## EmptyState Component Usage ### Description This example shows how to use the `EmptyState` component with its core props for displaying a message when no data is available. ### Method N/A (Component Usage) ### Endpoint N/A (Component Usage) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```tsx ``` ### Response N/A (Component Usage) #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Define and Use Custom Presets Source: https://github.com/infinitered/ignite/blob/master/docs/concept/Styling.md Create custom presets by combining base styles with specific theme-aware style functions, then apply them to components. ```tsx const $warning: ThemedStyle = (theme) => ({ backgroundColor: theme.colors.alert, color: "white", padding: theme.spacing.lg, }) const $viewPresets: Record> = { destructive: [$baseViewStyle, $warning], } ``` ```tsx