react-native-copy-paste

1.0.0 • Public • Published

Copy & Paste

Example

import React from 'react';
import { View, Text, Button } from 'react-native';
import { copyToClipboard, pasteFromClipboard } from 'react-native-copy-paste';

const CopyComponent = () => {
    const handleCopy = (text) => {
        copyToClipboard(text);
    };
    const text = "Hello World";

    const handlePaste = async () => {
        await pasteFromClipboard();
    };

    return (
        <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
            <Text>Copy and Paste Example</Text>
            <Button title="Copy" onPress={handleCopy(text)} />
            <Button title="Paste" onPress={handlePaste} />
        </View>
    );
};

export default CopyComponent;

Installation

  • Can be used as npm package and:
npm i react-native-copy-paste

Package Sidebar

Install

npm i react-native-copy-paste

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

1.65 kB

Total Files

3

Last publish

Collaborators

  • vinayki_khare