user2019645
user2019645

Reputation: 67

Cannot Import Clipboard

Clipboard seems to be a pretty standard part of react-native's API. All of the tutorials on react-native's Clipboard tell me the same thing, just do this:

import { Clipboard } from 'react-native';

and I'm golden. Problem is, I'm getting complaints from my IDE that I:

Cannot import Clipboard because there is no Clipboard export in react-native

I'm very confused at this point and it doesn't seem that anyone else through a quick google search of my error msesage has ever had this problem before. I don't even know how to even begin debugging this. Or if even needs debugging as the code seems to work perfectly fine despite the complaints.

Upvotes: 1

Views: 2127

Answers (1)

Tim
Tim

Reputation: 10709

The Clipboard module was moved to react-native-community/react-native-clipboard.

You can install it with:

npm install --save @react-native-community/react-native-clipboard

and import it with:

import Clipboard from "@react-native-community/react-native-clipboard";

You can read more about it here

Upvotes: 3

Related Questions