Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pytqqq/70c7d6d7298c898ff70d7d93601b36fe to your computer and use it in GitHub Desktop.
Save pytqqq/70c7d6d7298c898ff70d7d93601b36fe to your computer and use it in GitHub Desktop.
import React from "react";
import { Pressable, Text, View } from "react-native";
import { SlowList } from "./SlowList";
const AsyncComponent = () => {
const [count, setCount] = React.useState(0);
const handlePress = () => {
setTimeout(() => setCount((c) => c + 1), 10);
};
return (
<View>
<Pressable accessibilityRole="button" onPress={handlePress}>
<Text>Action</Text>
</Pressable>
<Text>Count: {count}</Text>
<SlowList count={200} />
</View>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment