This project is in early development and is not yet ready for use.
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
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>
);
}
lazy
prop to the existing components)