MCPcopy Create free account
hub / github.com/dailydotdev/apps / useEmojiFreeInput

Function useEmojiFreeInput

packages/shared/src/hooks/input/useEmojiFreeInput.ts:32–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30}
31
32export const useEmojiFreeInput = (): UseEmojiFreeInput => {
33 const [hasStrippedEmojis, setHasStrippedEmojis] = useState(false);
34
35 const onEmojiFreeInput = useCallback(
36 (event: SyntheticEvent<TextInputElement>) => {
37 if (stripEmojisFromInput(event.currentTarget)) {
38 setHasStrippedEmojis(true);
39 }
40 },
41 [],
42 );
43
44 const resetEmojiHint = useCallback(() => setHasStrippedEmojis(false), []);
45
46 return { hasStrippedEmojis, onEmojiFreeInput, resetEmojiHint };
47};

Callers 4

PollFormFunction · 0.90
LinkFormFunction · 0.90
TextForm.tsxFile · 0.90
WriteFreeformContentFunction · 0.90

Calls 1

stripEmojisFromInputFunction · 0.85

Tested by

no test coverage detected