-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Example to use it with expo go #23
Comments
wow ! wondering if i can add something like that in a futur version : useShareIntent({
disabled: true,
}); |
Notice that my previous code that use
If I early return, just before actually calling the imperactive api, it was safe. But in this version it still throw error when import the hook import { useShareIntent } from 'expo-share-intent';
// ...
if (process.env.NODE_ENV === 'development') {
return;
}
/* eslint-disable react-hooks/rules-of-hooks */
const { hasShareIntent, shareIntent, resetShareIntent, error } = useShareIntent({
debug: true,
}); Still throw the error |
Anyway this workaround does work, just for people googled here, closing this issue. I haven't get sharing work yet, because expo's dev client is not working, and they don't want to fix it expo/expo#27536 |
🤔 By the way, |
Thanks, I know that, I was just post old code to illustrate that old package can import and then conditionally block execution. But the new package is different. |
You can now simply disabled share intent to run it into expo go ( For example : const { shareIntent } = useShareIntent({ disabled: process.env.NODE_ENV === 'development'}) <ShareIntentProvider options={{ disabled: process.env.NODE_ENV === 'development'}}>
<App />
</ShareIntentProvider> |
Many thanks, this is convenient. |
Hi, I'm trying to use this new
When running the code using
Also it complains about the rule of hooks violation. I tried to use the package in my project with Is this example correct at the moment? Do I do something wrong? Btw, thank you very much for this package and updates to it! |
Sometimes we just want to use expo go to debut other parts of app, here is how to do it
and start it with
It was easier when this lib also export non-hook api, but I find it is possible to workaround it today, so share with anyone with same problem.
The text was updated successfully, but these errors were encountered: