This file contains hidden or 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 { Pressable as RNPressable, Text } from 'react-native' | |
| import { FlatList, Pressable } from 'react-native-gesture-handler' | |
| function TestComponent() { | |
| return ( | |
| <> | |
| <Text>RN</Text> | |
| <FlatList | |
| horizontal | |
| data={[1, 2, 3, 4, 5]} |
This file contains hidden or 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 { Pressable, Text } from 'react-native' | |
| import { | |
| Pressable as RNGHPressable, | |
| Text as RNGHText, | |
| } from 'react-native-gesture-handler' | |
| function Reproduction() { | |
| return ( | |
| <> | |
| <Pressable |
This file contains hidden or 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
| function Test() { | |
| return ( | |
| <> | |
| <View> | |
| <Pressable | |
| testID="good" | |
| style={(state) => ({ | |
| marginTop: 100, | |
| width: 50, |
This file contains hidden or 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 { Pressable, ScrollView } from 'react-native-gesture-handler' | |
| function Test() { | |
| return ( | |
| <ScrollView style={{ flexGrow: 1, backgroundColor: 'white' }}> | |
| <View style={{ paddingTop: 200, height: 2000 }}> | |
| <Pressable | |
| style={{ width: 30, height: 30, backgroundColor: 'pink' }} | |
| onPress={() => Alert.alert('pressed')} | |
| /> |
This file contains hidden or 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
| function Test() { | |
| const [shown, setShown] = useState(true) | |
| if (!shown) { | |
| return ( | |
| <Pressable | |
| key="1" | |
| testID="other-pressable" | |
| style={{ width: 30, height: 30, backgroundColor: 'red' }} | |
| onPress={() => console.log('pressed')} |
This file contains hidden or 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
| function Screen() { | |
| const opacity = useSharedValue(0) | |
| const [dimensions, setDimensions] = useState({ height: 0, width: 0 }) | |
| const containerAnimatedStyle = useAnimatedStyle(() => { | |
| 'worklet' | |
| return { | |
| opacity: opacity.value, | |
| transform: [{ scale: opacity.value }], | |
| } |
This file contains hidden or 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
| const [isPressed, setIsPressed] = useState(false) | |
| return ( | |
| <Pressable | |
| onPressIn={() => setIsPressed(true)} | |
| onPressOut={() => setIsPressed(false)} | |
| onPress={() => console.log('not called')} | |
| /> | |
| ) |
This file contains hidden or 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
| type input = `Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53 | |
| Card 2: 13 32 20 16 61 | 61 30 68 82 17 32 24 19 | |
| Card 3: 1 21 53 59 44 | 69 82 63 72 16 21 14 1 | |
| Card 4: 41 92 73 84 69 | 59 84 76 51 58 5 54 83 | |
| Card 5: 87 83 26 28 32 | 88 30 70 12 93 22 82 36 | |
| Card 6: 31 18 13 56 72 | 74 77 10 23 35 67 36 11`; | |
| type Split< | |
| Str extends string, | |
| Separator extends string, |
This file contains hidden or 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
| // Elm architecture - all data fetching is in the reducer | |
| reducer(state, action) { | |
| if (action === LOCATION_CHANGE && action.payload === '/send-payment') { | |
| return loop(state, Cmd.action(fetchData())) | |
| } | |
| if (action === FETCH_DATA) { | |
| return loop(state, corporateApiCall()) | |
| } |
This file contains hidden or 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
| headerToUsername :: Text -> Maybe Text | |
| headerToUsername authHeader = do | |
| JWT.stringOrURIToText <$> (JWT.sub =<< JWT.claims <$> JWT.decode authHeader) | |
| headerToUsernameDo :: Text -> Maybe Text | |
| headerToUsernameDo authHeader = do | |
| unverifiedJwt <- JWT.decode authHeader | |
| subject <- JWT.sub $ JWT.claims unverifiedJwt | |
| return $ JWT.stringOrURIToText subject |
NewerOlder