andrew-levy / jetpack-compose-react-native

107 stars 2 forks source link

Jetpack Compose React Native

This project is in early development and is not yet ready for use.

Getting started

Add the plugin to your app.json. This will allow your Android app to use Jetpack Compose.

{
  "plugins": ["jetpack-compose-react-native"]
}

Next, prebuild your app.

npx expo prebuild -p android --clean

Usage

import { Button, Switch, Column, Text } from "jetpack-compose-react-native";
import { useState } from "react";

export default function App() {
  const [checked, setChecked] = useState(false);
  return (
    <Column>
      <Text>Use Jetpack Compose views in your RN app!</Text>
      <Button title="Press me" onClick={() => console.log("Button pressed")} />
      <Switch
        checked={checked}
        onCheckedChange={(isChecked) => setChecked(isChecked)}
      />
    </Column>
  );
}

To Do