mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
* deps(react-native-gesture-handler/@react-native-clipboard/clipboard): Updates related to RN 0.73.8
19 lines
409 B
TypeScript
19 lines
409 B
TypeScript
import Clipboard from '@react-native-clipboard/clipboard';
|
|
|
|
/**
|
|
* Tries to copy a given text to the clipboard.
|
|
* Returns true if the action succeeds.
|
|
*
|
|
* @param {string} textToCopy - Text to be copied.
|
|
* @returns {Promise<boolean>}
|
|
*/
|
|
export function copyText(textToCopy: string) {
|
|
try {
|
|
Clipboard.setString(textToCopy);
|
|
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
}
|