[English] React Native Beginner — Copy Text to Clipboard
Hello, see again with React Native Zone. In this week we’ll get to know the Clipboard. Ever heard? When we are open the application payment (in example) that requires us to type booking code from application to another application. Maybe we can remember it if the booking code is short. But what if the booking code is long?
As a React Native Developer, we can use Clipboard. To take advantage of the text we want to copy and the user just paste.
This can make it easier for users to copy the booking code is quite long. How to implement it using the following way
import { Clipboard } from 'react-native';
...
...onClick() {
Clipboard.setString("booking code");
}
That way the user just copy the code by using the paste feature on the smartphone.
So this short article, may be useful for you.
Thanks.
06.00 PM at Surabaya, Indonesia.