diff --git a/Examples/UIExplorer/ClipboardExample.js b/Examples/UIExplorer/ClipboardExample.js index 0adfdd6f5..fa2814a2a 100644 --- a/Examples/UIExplorer/ClipboardExample.js +++ b/Examples/UIExplorer/ClipboardExample.js @@ -28,6 +28,7 @@ var ClipboardExample = React.createClass({ content: 'Content will appear here' }; }, + async _setClipboardContent(){ Clipboard.setString('Hello World'); try { @@ -36,8 +37,8 @@ var ClipboardExample = React.createClass({ } catch (e) { this.setState({content:e.message}); } - }, + render() { return ( diff --git a/Libraries/Components/Clipboard/Clipboard.js b/Libraries/Components/Clipboard/Clipboard.js index 0abc57010..9b3ef5950 100644 --- a/Libraries/Components/Clipboard/Clipboard.js +++ b/Libraries/Components/Clipboard/Clipboard.js @@ -23,10 +23,10 @@ module.exports = { * var content = await Clipboard.getString(); * } * ``` - * @param this parameter is deprecated. callback is function with one argument of string type */ - getString(callback) { - if (callback) { + getString() { + if (arguments.length > 0) { + let callback = arguments[0]; console.warn('Clipboard.getString(callback) is deprecated. Use the returned Promise instead'); Clipboard.getString().then(callback); return;