profile
viewpoint

startedlord/slate

started time in a month

startedrecharts/recharts

started time in a month

startedstyleguidist/react-styleguidist

started time in a month

startedchinese-poetry/chinese-poetry

started time in a month

startedryanmcdermott/clean-code-javascript

started time in 2 months

startedi5ting/How-to-learn-node-correctly

started time in 2 months

startedtannerlinsley/react-table

started time in 3 months

startedfilamentgroup/tablesaw

started time in 3 months

issue closednihey/react-clipboard.js

How to make option-text derive from async/await

Hello, I need help

getClipboardText = async () => {
    const { uid, templateId, content } = this.props
    const { data } = await getTinyUrl(templateId, { uid })
    return `${content} ${data}`
}
render () {
    return <Clipboard option-text={this.getClipboardText} >Copy</Clipboard>
}

Code above doesnt work, why and how to make it works

closed time in 3 months

guonanci

issue commentnihey/react-clipboard.js

How to make option-text derive from async/await

Hi, Do you have additional information on this problem? Some traceback that is generated or any warning?

In my clipboard, is [object Promise] and no other information. @nihey

let content = await this.getClipboardText(); If you don't wait for the result , A Promise object will be returned

OK, thanks very much!

guonanci

comment created time in 3 months

startedmathiasbynens/jsesc

started time in 3 months

more