r5n-labs / react-native-otp-inputs

OTP inputs for React-Native
MIT License
249 stars 91 forks source link

Expo has a Clipboard API #274

Closed hirbod closed 2 years ago

hirbod commented 2 years ago

https://docs.expo.dev/versions/latest/sdk/clipboard/

And since it is easy installable outside of Expo (https://github.com/expo/expo/tree/master/packages/expo-clipboard) it should be used as the main library for broad user support.

ice-chillios commented 2 years ago

@Hirbod I disagree. Expo forces you to use it on your project and integrate it with the rest of expo-modules stuff. It also has half of the main clipboard package installs.

hirbod commented 2 years ago

expo-modules-core is a lean and clean approach. Expo changed a lot - no forces anymore with EAS, Custom Dev Clients etc.

Since I am using custom dev clients, it is already working with Expo for me anyway!

But it’s fine! I will fork your project and adjust to my needs.

You could also think about to support both worlds

ice-chillios commented 2 years ago

@Hirbod I'm happy to merge PR if it would support both approaches.

crieggalder commented 2 years ago

Hey @chillios-ts - @hirbod is right. Expo clipboard works great with or without Expo, so it's the best solution. And luckily it's a drop-in replacement! Clipboard.setString() is the same, and Clipboard.getString() becomes Clipboard.getStringAsync().

I'd PR it but looks like there are already some pending PRs. If you're still maintaining this, would you consider just swapping the deps? Should be 3 lines of changed code total.