diff --git a/example/app/_layout.tsx b/example/app/_layout.tsx index 9efb0a7..d02e21d 100644 --- a/example/app/_layout.tsx +++ b/example/app/_layout.tsx @@ -1,3 +1,14 @@ +/* eslint-disable import/no-duplicates */ +/* eslint-disable prettier/prettier */ +import "react-native-gesture-handler"; import { Slot } from "expo-router"; +import { StyleSheet } from "react-native"; +import { GestureHandlerRootView } from "react-native-gesture-handler"; -export default Slot; +export default () => ( + + + +); + +const styles = StyleSheet.create({ container: { flex: 1 } }); diff --git a/example/app/index.tsx b/example/app/index.tsx index 5218cbd..c463912 100644 --- a/example/app/index.tsx +++ b/example/app/index.tsx @@ -1,30 +1,31 @@ import { LineChart } from "@codeherence/react-native-graph"; -import { useMemo } from "react"; -import { StyleSheet, View } from "react-native"; +import { useCallback, useState } from "react"; +import { Button, StyleSheet, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; import { Banner } from "../components/Banner"; +const generateRandomData = (): [number, number][] => { + return Array.from({ length: 100 }, (_, i) => [i, Math.random() * 2000]); +}; + export default () => { const { top, bottom } = useSafeAreaInsets(); + const [data, setData] = useState<[number, number][]>(generateRandomData()); - const data: [number, number][] = useMemo(() => { - return Array.from({ length: 20 }, (_, i) => [i, Math.random() * 2000]); + const handlePress = useCallback(() => { + setData(generateRandomData()); }, []); return ( - } - /> +