-
Notifications
You must be signed in to change notification settings - Fork 203
Use a global list of clipboard listeners #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@pvinis hmm, is the checklist up to date? I went to add my changes to the changelog but it seems like it's generated automatically? |
Indeed. we need to revisit that. |
Ahh, it comes from here: Hmm, maybe we can just override it by adding our own version 🤔 |
I've added a snack to test this out here: 🎉 |
for sure. today and tomorrow I'm not easily next to my laptop, I could check later, or if you do something we check it. |
Did it here: #77 This PR should be ready for review now, I've tested it on my iPhone and on the Web. Should be super easy for anyone to test out the snack |
having the snack is awesome! maybe we can add this in the template as a suggestion? 🤔 |
I also plan to add some tests so people can copy paste and use them too. |
Hehe, already did it in #77 😉
Maybe we could have an official snack which uses all the hooks. Then people can just fork that one and add whatever is specific to their PR? 🤔 Since each PR gets deployed with a canary version it's super easy to use them in the snacks 🙌 |
yuuuuuuuuuusssssss!!! awesome idea. |
ping @pvinis, can we merge this? |
uup, forgot that. No one reviewed, lemme give it a look. |
For reference, here is the broken version https://snack.expo.io/ByOfrk6r8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 PR was released in |
Summary
Before this change, if two components on the same page used the clipboard hook, one of them wouldn't properly re-render if the other one updated the clipboard content.
Test Plan
I'm working on a small example app that shows two components that uses the clipboard at the same time, and demonstrates that it now works.Here is a snack that demonstrates the working behaviour:
https://snack.expo.io/@linusu/hooks-pr-76
What's required for testing (prerequisites)?
What are the steps to reproduce (after prerequisites)?
Compatibility
Checklist
README.md
CHANGELOG.md
example/App.js
)📦 Published PR as canary version:
2.4.4-canary.76.172.0
✨ Test out this PR locally via: