question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ClipboardCopy doesn't update when children are updated

See original GitHub issue

Screen Recording 2019-09-05 at 9 18 04 AM mov

The ClipboardCopy component should be updating along with the counter in that video, but it doesn’t.

Here’s the code to generate that example:

class Test extends React.Component<{}, { counter: number }> {
    constructor(props) {
        super(props);
        this.state = { counter: 0 };
    }

    componentDidMount() {
        setInterval(
            () => this.setState({ counter: this.state.counter + 1 }),
            1000,
        );
    }

    render() {
        return (
            <React.Fragment>
                {this.state.counter.toString()}
                <ClipboardCopy>{this.state.counter.toString()}</ClipboardCopy>
            </React.Fragment>
        );
    }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
SpyTeccommented, Sep 5, 2019

@newswangerd submitted a PR for it in #2849, luckily it’s an easy fix 😃

0reactions
newswangerdcommented, Oct 3, 2019

@redallen I tested it on code sandbox, and it worked. I did some digging and it turns out this was breaking on my app because the dependencies didn’t get reloaded correctly after I updated them. Sorry to bother you with this!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Clipboard not working - Microsoft Community
Written Jul 14/2020: Since the most recent Windows 10 update, clipboard does not work. "Paste" in greyed and will not function.
Read more >
iOS 16.1 Introduces New Copy-and-Paste Permission Settings ...
iOS 16 introduced a new privacy feature that requires apps to receive a user's permission before directly accessing their iPhone's clipboard.
Read more >
Cut, copy, and paste between iPad and other devices
Cut, copy, and paste between iPad and other devices. You can use Universal Clipboard to cut or copy content (a block of text...
Read more >
How to Fix Copy and Paste Not Working in Windows 11
How to Fix Copy and Paste Not Working in Windows 11 · 1. Perform a Clean Boot · 2. Update Your Windows ·...
Read more >
Copy and paste objects in the canvas – Figma Help Center
Use the Paste to replace function to remove a selected object from your canvas or frame and replace it with the object copied...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found