Created
February 8, 2023 13:54
-
-
Save pytqqq/70c7d6d7298c898ff70d7d93601b36fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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