Open ICardosoRamos opened 1 year ago
I am too having the same issue, peculiarly on npx expo start
. It doesn't show with eas build either production or dev-client. The error shows in expo cli
TypeError: Cannot read property 'setString' of null, js engine: hermes
However in Expo go
Cannot read property 'setString' of null
Guys, if you're using Expo, check this comment referring to this library.
Guys, I solved my problem with clipbord using React Native CLI. To use it in Expo, you need to use their own lib.
Ask your Question
import React from 'react'; import { Linking, TouchableOpacity } from 'react-native'; import Toast from 'react-native-toast-message'; import Clipboard from '@react-native-clipboard/clipboard';
import { KBoleto } from '.';
import { Strong, StyledBoletoStatus, StyledDivider } from './style'; import KButton from 'components/Button'; import { Text } from 'components/Typography'; import { Box, HStack, VStack, View } from 'native-base'; import { Shadow } from 'react-native-shadow-2'; import { getBRL } from 'utils/number'; import { Icon } from 'components/Icon'; import { BASE_URL } from 'hooks/useAxios/axiosConfig';
function formatDate(date: string) { const dateString = date.split('-').reverse(); dateString.shift(); return dateString.join('/'); }
function formatDateVencimento(date: string) { return date.split('-').reverse().join('/'); }
async function handleOpenLink(url: string) { try { const supported = await Linking.canOpenURL(url); if (!supported) throw new Error('Boleto indisponivel no momento'); await Linking.openURL(DEV ?
${BASE_URL}/${url}
: url); } catch { Toast.show({ type: 'error', text1: 'Tente novamente', text2: 'Boleto indisponivel no momento', }); } }function Boleto({ boleto }: { boleto: KBoleto }) { const boletoReferencia = formatDate(boleto.referencia);
}
export default Boleto;
I have this code above, and it's all up with the example in the documentation to use Clipboard, but some error are happening. First in the IOS, i'm leaving a printscreen below:
Now in the Android, also leaving an printscreen below:
PLEASE IF SOMEONE COULD HELP ME I WILL THANKS A LOT.