Comments (9)
For those having this issue, instead of using the useClipboard
hook, use the Clipboard
object depending on what you want to do. If you use the useClipboard
hook, it gets what is in the clipboard when the screen is mounted, however, if you use the Clipboard
function, you can read the clipboard only when you need to.
from clipboard.
Pre-iOS 14, the way to check clipboard content was to look at the data in it, so this is why you get the notification you pasted from the clipboard. The API for iOS 14 has been updated to allow you to check clipboard content without actually looking at the data (and avoiding the notification).
from clipboard.
Nice then, I will create an issue, and we'll go from there! @EricWiener
from clipboard.
I'm facing the same issue, is there any solution or workaround for this issue?
from clipboard.
Interesting.
Looking at the recent TikTok news regarding exactly this behaviour, this should better be investigated.
from clipboard.
Actually i found that my issue was not with react native clipboard, it was coming from firebase dynamic links v6.3 once i commented out Firebase/DynamicLinks dependency in my PodFile it went away.
Hope that helps.
from clipboard.
Pre-iOS 14, the way to check clipboard content was to look at the data in it, so this is why you get the notification you pasted from the clipboard. The API for iOS 14 has been updated to allow you to check clipboard content without actually looking at the data (and avoiding the notification).
@EricWiener is this implemented with this library? I think this API would really benefit a lot of RN apps.
(if not I will probably create a separate issue for it)
from clipboard.
Pre-iOS 14, the way to check clipboard content was to look at the data in it, so this is why you get the notification you pasted from the clipboard. The API for iOS 14 has been updated to allow you to check clipboard content without actually looking at the data (and avoiding the notification).
@EricWiener is this implemented with this library? I think this API would really benefit a lot of RN apps.
(if not I will probably create a separate issue for it)
@filiptronicek It hasn't been implemented here yet (I just took a look at the commits). I'd be happy to work on it, but I won't be able to start until August 21st (restricted by current job).
from clipboard.
@focux Do you have an example of something that works?
I build a custom hook using the Clipboard
methods instead of useClipboard
, but still see the toast message in some cases.
export const useCustomClipboard = () => {
const [clipboardContent, setClipboardContent] = useState('')
// This effect gets the native Clipboard content on first mount
// and sets clipboardContent accordingly
useEffect(() => {
Clipboard.getString().then(setClipboardContent)
}, [])
// This effect sets native Clipboard string when clipboardContent changes
useEffect(() => {
Clipboard.setString(clipboardContent)
}, [clipboardContent])
return [clipboardContent, setClipboardContent]
}
Weirdly, I consistently get the toast message every time I call Clipboard.getString()
with a new string in the clipboard...
from clipboard.
Related Issues (20)
- andriod build failed
- Hide Eclipse
- Cannot use the attributes of Clipboard in windows
- Unable to empty clipboard :) HOT 1
- Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl. Namespace not specified. HOT 7
- [Android-New Arch] Cannot specify link libraries for target "react_codegen_RNCClipboard" which is not built by this project HOT 15
- Can we deprecate the NPM package for @react-native-community/clipboard
- no idea why need to link
- How get to work with Expo HOT 1
- App Hanging: App hanging for at least 2000 ms. Happens for iOS devices only. HOT 3
- Clear the clipboard
- Android: After upgrading to React Native version 0.73, build failed HOT 7
- Monorepo REACT_NATIVE_NODE_MODULES_DIR error HOT 2
- Getting "copied" send to device in android 13 HOT 1
- Task :react-native-community_clipboard:compileDebugJavaWithJavac FAILED HOT 14
- SetString("") not clear Gboard's clipboard
- Expose access to EXTRA_IS_SENSITIVE for setString on Android
- Error to Deploy to Android RN 0.73.2 HOT 6
- ios listener not being called
- public class ClipboardModule extends NativeClipboardModuleSpec 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 clipboard.