-
Notifications
You must be signed in to change notification settings - Fork 79
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
How to shared function instead of component between each app #61
Comments
@kiethuynh0904 I haven't run the code but I believe that you're free to expose AuthContext so you can // AuthContext // Expose one more module in here // And then import federated module from your package Ensure you always useContext within the AuthProvider. |
Notice: You will soon have problem since this is not recommended way to share the functions. You should share the state instead. |
Thanks for your answer. Yeah It's worked fine with context, but sometimes I have an // The same example: https://github.com/callstack/repack-examples/tree/main/module-federation |
Why don't you make an independent npm package for |
Yeah, I know what you mean but my project does not wanna have an independent npm package |
Ask your Question
First of all, thanks for all your efforts in this package.
I have a question. what best way to share functions between each app?
example: for this repo, we have
Auth
module to provide authentication UI, but I just want to share functions likesignIn
andsignout
instead ofAccount
&SignInScreen
. So how to do that?The text was updated successfully, but these errors were encountered: