Red Shift

The official Infinite Red publication for React Native design & development. We’re a fully distributed team building world-class apps for over 20 years for clients all around the world.

Follow publication

Making your own React Native custom components with Ignite generators

Jamon Holmgren
Red Shift
Published in
4 min readApr 12, 2021

--

ignite generate screen Welcome
YourApp
app
screens
welcome
welcome-screen.tsx

Previous Versions

Ignite 6.x Generators

YourApp
ignite
templates
component
model
navigator
screen
ignite generate component JamonHolmgren

Templating with ejs

<%= props.pascalCaseName %>
Example from the model generator template

How to make your own generator

ignite generate hook useIgnite
import { Alert } from "react-native"
import { useEffect } from "react"
export const <%= props.camelCaseName %> = () => {
useEffect(() => {
Alert.alert("Triggered <%= props.camelCaseName %>")
}, [])
}
ignite generate hook useIgnite
Generated new files:
/Users/jh/Code/DemoApp/app/hooks/use-ignite/use-ignite.ts
import { Alert } from "react-native"
import { useEffect } from "react"
export const useIgnite = () => {
useEffect(() => {
Alert.alert("Triggered useIgnite")
}, [])
}

Final thoughts

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Published in Red Shift

The official Infinite Red publication for React Native design & development. We’re a fully distributed team building world-class apps for over 20 years for clients all around the world.

Written by Jamon Holmgren

Co-founder & CTO @infinite_red. Lutheran, husband, dad to 4, React Native Radio podcast host, Twitch streamer, hockey goalie. Talking shop!

Responses (1)

Write a response