Comments (2)
I have not seen this error before, so I am not sure without a minimal reproduction. My guess is that your Component re-rendering is attempting to set the clipboard.
Setting the clipboard causes a re-render, because the first parameter of useClippy
is the current clipboard value.
If you are setting the clipboard on render, this can trigger an infinite loop. This error may be Chrome bailing out of that loop.
Potential areas of interest:
On line 115, we execute the copy command: https://github.com/CharlesStover/use-clippy/blob/master/src/use-clippy.ts#L115
On line 141, we listen for the copy event and rerender when it occurs: https://github.com/CharlesStover/use-clippy/blob/master/src/use-clippy.ts#L141
On line 177, we execute the copy command and also re-render: https://github.com/CharlesStover/use-clippy/blob/master/src/use-clippy.ts#L177
While this, at worst, should just result in two re-renders instead of one, there may be funky logic here that causes Chrome to think the clipboard is being accessed too frequently.
I would first investigate that you aren't just setting the clipboard on each render.
from use-clippy.
Thanks for your response, I don't have time to investigate deeper, I'm using another similar hook from react-use
package and it works ok now.
from use-clippy.
Related Issues (19)
- [Security] Reading the clipboard is disabled in browsers.
- Have problem on Firefox HOT 3
- Memoize setClipboard
- Copy events do not trigger local state changes in latest version of Chrome. HOT 4
- Get clipboard contents on load? HOT 5
- Safari support HOT 3
- Reading the clipboard does not work in some versions of Safari. HOT 2
- paste not updating `clipboard` HOT 2
- Deploy a live demo to GH Pages.
- image support? HOT 1
- Only write permissions version HOT 3
- Using clippy across multiple components does not propagate changes to the clipboard of each component
- Write a Medium article for how this was made and/or how to use it.
- modal with useClippy in it scrolls the page HOT 1
- Failed to copy with DOMException document not focused in latest firefox / chrome.
- Disable reading from clipyboard. HOT 1
- Unwanted side effects in Safari HOT 4
- React version dependency HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from use-clippy.