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, { useContext, useEffect, useState, useCallback } from 'react'; | |
import { TouchableWithoutFeedbackProps } from 'react-native'; | |
import useDelayedState from './useDelayedState'; | |
const FocusChangeContext = React.createContext<(isFocused: boolean, instant?: boolean) => void>( | |
() => undefined | |
); | |
const HasFocusContext = React.createContext<boolean>(false); |
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 { useState, useCallback } from 'react' | |
import { LayoutChangeEvent } from 'react-native' | |
interface Measurement { | |
width: number | |
height: number | |
} | |
type OnLayoutCallback = (event: LayoutChangeEvent) => void |
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
diff --git a/node_modules/@types/react-native/index.d.ts b/node_modules/@types/react-native/index.d.ts | |
index dba6a80..114a383 100644 | |
--- a/node_modules/@types/react-native/index.d.ts | |
+++ b/node_modules/@types/react-native/index.d.ts | |
@@ -63,6 +63,41 @@ | |
import * as React from 'react'; | |
+export const TVMenuControl: { | |
+ enableTVMenuKey(): void; |
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 '@types/react-native'; | |
import React from 'react'; | |
import { ViewProps } from 'react-native'; | |
declare module 'react-native' { | |
export const TVMenuControl: { | |
enableTVMenuKey(): void; | |
disableTVMenuKey(): void; | |
}; |
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 { useState, useEffect } from 'react' | |
export default function useDebouncedState<T>(value: T, delay: number) { | |
const [debouncedValue, setDebouncedValue] = useState<T>(value) | |
useEffect(() => { | |
const handler = setTimeout(() => setDebouncedValue(value), delay) | |
return () => clearTimeout(handler) | |
}, [value, delay, setDebouncedValue]) |
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
{ | |
"name": "use-debounce", | |
"version": "1.0.0", | |
"main": "useDebounce.ts" | |
} |
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
{ | |
"name": "use-fuse", | |
"version": "1.0.1", | |
"main": "useFuse.ts" | |
} |
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
type AnyValue = | |
| { [key: string]: AnyValue } | |
| { [key: number]: AnyValue } | |
| AnyValue[] | |
| string | |
| number | |
| boolean | |
| null | |
| undefined | |
| symbol |
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, { useRef, useImperativeHandle } from 'react'; | |
import type { HostComponent } from 'react-native'; | |
import { | |
NativeModules, | |
findNodeHandle, | |
Platform, | |
UIManager, | |
requireNativeComponent, | |
} from 'react-native'; |
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
#!/bin/bash | |
if ! command -v gh &>/dev/null; then | |
echo "The GitHub CLI <gh> could not be found." | |
read -p "Do you want to install it? " -n 1 -r | |
echo | |
if [[ $REPLY =~ ^[Yy]$ ]]; then | |
echo "Installing GitHub CLI..." | |
if ! command -v brew &>/dev/null; then | |
echo "The <brew> command could not be found." |