Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Usage example issue #62

Closed
ymc182 opened this issue Sep 9, 2021 · 5 comments
Closed

Usage example issue #62

ymc182 opened this issue Sep 9, 2021 · 5 comments

Comments

@ymc182
Copy link

ymc182 commented Sep 9, 2021

I have an issue when following the example, the button is created and showing phatomRPCJSON with the pubkey when its connected, but I can't use the button in Usage example and it's throwing not connected error, did I missed anything?
image

@jordaaash
Copy link
Collaborator

Hmm. Can you publish a repo with your example project? I can take a look at what's going on. Hard for me to tell from just the screenshot unfortunately.

@ymc182
Copy link
Author

ymc182 commented Sep 9, 2021

Thanks for the quick reply,
I have created the repo and it did reproduce the problem
https://github.com/ymc182/testSol

@jordaaash
Copy link
Collaborator

The issue is that your connection / wallet providers need to be the ancestor components of anything that calls useConnection / useWallet. You have them as siblings. Wrap your app with the contexts.

Screenshot_20210909-153859

@jordaaash
Copy link
Collaborator

Take a look at the example project for how this is done. You basically want those contexts at the top level of your app.

@ymc182
Copy link
Author

ymc182 commented Sep 10, 2021 via email

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants