# React Native (/docs/native/getting-started/installation/react-native)

<Steps>
<Step>
### Add Expo modules [#add-expo-modules]

<InstallTabs commands={[{ verb: "dlx", packages: ["install-expo-modules@latest"] }]} />

The library needs `expo-linear-gradient`, and `expo install` is what pins every native module to a
version your React Native builds. Your app stays a React Native CLI app.
</Step>

<Step>
### Install the packages [#install-the-packages]

<LibraryInstall />
</Step>

<Step>
### Add the worklets Babel plugin [#add-the-worklets-babel-plugin]

```js title="babel.config.js"
module.exports = {
  presets: ["module:@react-native/babel-preset"],
  plugins: ["react-native-worklets/plugin"],
};
```

Reanimated 4 needs it, and it must be **last** in `plugins`. Expo's preset adds it for you; the
React Native preset does not.
</Step>

<Step>
### Create the CSS entry [#create-the-css-entry]

```css title="global.css"
@import "tailwindcss";
@import "uniwind";
@import "@delacour/react-native-ui/styles";

@source "./App.tsx";
@source "./src";
@source "./node_modules/@delacour/react-native-ui/src";
```

Point the first `@source` at your own code. In a monorepo use the library's real path — Tailwind's
scanner does not follow symlinks.
</Step>

<Step>
### Wrap Metro with Uniwind [#wrap-metro-with-uniwind]

```js title="metro.config.js"
const { getDefaultConfig } = require("@react-native/metro-config");
const { withUniwindConfig } = require("uniwind/metro");

const config = getDefaultConfig(__dirname);

module.exports = withUniwindConfig(config, {
  cssEntryFile: "./global.css",
  dtsFile: "./uniwind-types.d.ts",
});
```

`withUniwindConfig` must be the **outermost** wrapper.
</Step>

<Step>
### Mount the provider [#mount-the-provider]

```tsx title="App.tsx"
import "./global.css";
import { Button } from "@delacour/react-native-ui/button";
import { DelacourProvider } from "@delacour/react-native-ui/provider";
import { useState } from "react";
import { View } from "react-native";

export default function App() {
  const [count, setCount] = useState(0);

  return (
    <DelacourProvider>
      <View className="flex-1 items-center justify-center bg-background">
        <Button onPress={() => setCount(count + 1)}>Pressed {count} times</Button>
      </View>
    </DelacourProvider>
  );
}
```

The CSS import is the **first statement**, and the provider wraps everything once. Both fail
silently when missing.
</Step>

<Step>
### Build and run [#build-and-run]

```bash
cd ios && pod install && cd ..
npx react-native run-ios
```

`npx react-native run-android` for Android.
</Step>
</Steps>

## Check the wiring [#check-the-wiring]

<InstallTabs commands={[{ verb: "dlx", packages: ["delacour@latest doctor"] }]} />
