Installing native-recipe
npm install @lynstack/native-recipepnpm add @lynstack/native-recipeyarn add @lynstack/native-recipebun add @lynstack/native-recipeIts one dependency is @lynstack/recipe. React Native is
a peer dependency: the package checks styles against its types, and imports
nothing from it at runtime.
Requirements
Section titled “Requirements”| Needs | Supported |
|---|---|
| TypeScript | 5.4 or newer |
| Runtimes | Node.js 16.9, Bun 1.0, Deno 2.0, or newer |
| Browsers | ES2022: Chrome 93, Firefox 92, Safari 15.4, or newer |
| Modules | ES modules only: import it, or require it in Bun or from Node.js 20.19, 22.12, or newer |
| React Native | 0.76 or newer, as in Expo SDK 52 or newer |
Every change runs each package on the oldest and the newest Node.js, Bun, and Deno in this table, and compiles its types with the oldest and the newest TypeScript.
TypeScript setup
Section titled “TypeScript setup”In an Expo app, tsconfig.json extends expo/tsconfig.base, which works
as it is. A React Native CLI app extends @react-native/typescript-config,
which works too.
A tsconfig that you write by hand can report errors inside React Native’s
own type declarations. Some, such as Duplicate identifier 'FormData',
come from the DOM types, which declare the same globals as React Native.
Others come from React Native’s declarations themselves, which do not
compile without skipLibCheck. Set skipLibCheck, and leave the DOM out
of lib:
{ "compilerOptions": { // Next to your other options, such as "jsx" and "module". "lib": ["ES2022"], "skipLibCheck": true, "strict": true, },}Next steps
Section titled “Next steps”- Quick start creates your first recipes.
- Why native-recipe explains when a recipe helps.