Comments (6)
I separated the WalletController
into a separate package. This no longer requires dependence such as react
.
I am not going to change the API, so if possible, I would like you to install this alpha version and test it together.
from wallet-provider.
@Stradivario https://github.com/terra-money/wallet-provider/tree/main/templates/wallet-controller
Please refer to this link.
class WalletController
, the under part of the wallet-provider
, was created based on RxJs, and React APIs such as useWallet()
bind it.
WalletController
can be used directly if you want. However, it will not be as convenient as the React API.
However, since internal parts such as Modal still use React, it is still necessary to add package.json dependencies for React. (I will then work on removing React from internally)
from wallet-provider.
I check the code and i saw that here https://github.com/terra-money/wallet-provider/blob/main/packages/src/%40terra-money/wallet-provider/index.ts#L3
We are exporting ./impl-react
and @terra-money/use-wallet
which are libraries using react
So if i don't install react i will get the error 'react-dom' or 'react' cannot be found in dependency resolution.
Even if i install react i will get an error that i don't use the correct way react
Uncaught (in promise) Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
at resolveDispatcher (react.development.js:1476)
at useContext (react.development.js:1484)
at useWallet (useWallet.ts:374)
at TerraProvider.<anonymous> (terra.provider.ts:72)
at Generator.next (<anonymous>)
at terra.provider.ts:4
at new Promise (<anonymous>)
at __awaiter (terra.provider.ts:4)
at TerraProvider.OnInit (terra.provider.ts:62)
at ContainerInstance.getServiceValue (ContainerInstance.js:244)
So there is a big problem using it with other libraries or native.
I will write down a few things today and i will let you know if i can remove every usage of react and leave the core logic untouched. After that we can just connect the react with the generic controller.
Cheers and thanks for the fast response!
from wallet-provider.
@Stradivario Is this an error when you only use WalletController
?
I will check this error tomorrow.
Unfortunately, it still needs to install react
, react-dom
, and styled-components
in your dependencies
. The reason why React exists in multiple copies may be because node_modules
is not flat. (If you add react
, react-dom
, and styled-components
to your dependencies
and the problem continues, try npm deadupe
or yarn dedupe
)
Anyway, I'll look into this tomorrow.
from wallet-provider.
https://github.com/terra-money/wallet-provider/releases/tag/v3.2.0
from wallet-provider.
Hey @iamssen thanks for the effort doing these changes!
I will try it out today and will write down how the things are going.
I am sorry for the late reply but i am having some production deployments and i don't have much time to test this out.
Cheers!
from wallet-provider.
Related Issues (20)
- Post transaction becomes unusable when user is inactive HOT 4
- Update Modal to allow for Desktop Deeplinks to Desktop Terra Station App
- problem with terra station HOT 1
- Interchain wallet
- Hooks do not update when changing network
- Signbytes public key is different from my own public key
- Wallet sign result return Dangerous tx
- Wallet status is still `INITIALIZING` after denying connect request
- Get address of signer after verifying bytes HOT 1
- [TERRA] No handler found event: SYN
- Include broadcast error from TxResult in connectedWallet.post
- How to get cw20tokens HOT 4
- Unable to start the application HOT 1
- [plugin server-bare-modules] Package subpath './package.json' is not defined by "exports" when using remix.run HOT 1
- Change network to Classic in the web wallet
- How to add keplr wallet ?
- The engine "node" is incompatible with this module. Expected version ">=16". Got "14.19.3"
- Terra Station Wallet signing problem for Classic HOT 2
- Popup with XDefi
- Trx msgs are not serialized properly for Wallet Connect on Classic network. HOT 1
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 wallet-provider.