Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clipboard interaction is now in the React Native core #5

Closed
ltk opened this issue Mar 2, 2016 · 1 comment
Closed

Clipboard interaction is now in the React Native core #5

ltk opened this issue Mar 2, 2016 · 1 comment

Comments

@ltk
Copy link

ltk commented Mar 2, 2016

Just a note to others that a Clipboard API has been part of RN core since version 0.17: https://github.com/facebook/react-native/blob/master/Libraries/Components/Clipboard/Clipboard.js (It will be included in the React Native documentation site soon.)

Usage is as follows:

import { Clipboard } from 'react-native';

Clipboard.setString('clipboard-contents');

async _getContent() {
   var content = await Clipboard.getString(); // getString() returns a Promise
 }

It could be worth a brief note in the README that no external clipboard dependency is needed if using a newer version of RN.

@silentcloud
Copy link
Owner

Thanks for the note!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants