Skip to content

Send files directly between devices over the internet - no cloud storage, no size limits.

385 B
Raw Blame
import * as Clipboard from 'expo-clipboard'
import { selectionTap } from '@/src/haptics'

export function usePasteFromClipboard(onText: (text: string) => void) {
  return () => {
    Clipboard.getStringAsync()
      .then((text) => {
        if (!text) return
        onText(text)
        selectionTap()
      })
      .catch((err) => console.warn('clipboard read failed', err))
  }
}