diff options
Diffstat (limited to 'packages/dev-tools-pages/ts/components/code.tsx')
-rw-r--r-- | packages/dev-tools-pages/ts/components/code.tsx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/dev-tools-pages/ts/components/code.tsx b/packages/dev-tools-pages/ts/components/code.tsx index dbd1a7e3c..71d7a7752 100644 --- a/packages/dev-tools-pages/ts/components/code.tsx +++ b/packages/dev-tools-pages/ts/components/code.tsx @@ -164,7 +164,7 @@ class Code extends React.Component<CodeProps, CodeState> { ) : null} </Base> {navigator.userAgent !== 'ReactSnap' && canCopy ? ( - <Button onClick={this._handleCopyAsync}>{this.state.didCopy ? 'Copied' : 'Copy'}</Button> + <Button onClick={this._handleCopyAsync.bind(this)}>{this.state.didCopy ? 'Copied' : 'Copy'}</Button> ) : null} </Container> ); @@ -182,7 +182,7 @@ class Code extends React.Component<CodeProps, CodeState> { }); } } - private readonly _handleCopyAsync = async () => { + private async _handleCopyAsync(): Promise<void> { try { if ('clipboard' in navigator) { await (navigator as any).clipboard.writeText(this.props.children); |