MCPcopy Create free account
hub / github.com/andrew-levy/jetpack-compose-react-native / DialogsExample

Function DialogsExample

example/app/datepicker.tsx:5–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { Button, DatePicker } from "jetpack-compose-react-native";
4
5export default function DialogsExample() {
6 const [datePickerVisible, setDatePickerVisible] = React.useState(false);
7
8 return (
9 <ScrollView style={{ flex: 1 }} contentContainerStyle={{ padding: 20 }}>
10 <Text style={styles.header}>Datepickers Example</Text>
11 {datePickerVisible && (
12 <DatePicker
13 showModeToggle
14 confirmText="Confirm"
15 dismissText="Cancel"
16 onDismiss={() => setDatePickerVisible(!datePickerVisible)}
17 />
18 )}
19 <Button
20 text="Show DatePicker"
21 onClick={() => {
22 setDatePickerVisible(true);
23 }}
24 />
25 </ScrollView>
26 );
27}
28
29const styles = StyleSheet.create({
30 header: {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected