Solid.js Support
Solid.js Support
This PR integrates a new package for Solid first class support.
This covers the core "hooks"
- [x] useAccount -> createAccount
- [x] useAccountEffect -> createAccountEffect
- [x] useChainId -> createChainId
- [ ] useClient (type issue)
- [x] useConfig -> createConfig
- [x] useConnect -> createConnect
- [x] useConnections -> createConnections
- [ ] useConnectorClient -> createConnectorClient (error when being called)
- [x] useConnectors -> createConnectors
- [x] useDisconnect -> createDisconnect
- [x] useSwitchAccount -> createSwitchAccount
- [x] useSwitchChain -> createSwitchChain
Philosophy
Considerations:
- Tanstack query follows the same naming convention from Solid, which uses the prefix "create" for functions returning reactive values
- Tanstack functions return a Solid store, these stores cannot be destructured otherwise they lose reactivity.
- To avoid confusion we are using "stores" (built on top of signals) instead of "signals", since the values are accessed differently (signals are functions). Since stores cannot be desctructured and for some "hooks" we are returning values from Query and from Wagmi at the same time, the return type is going to be an object containing these stores.
Example:
function Account(){
const { account } = createAccount()
return <div>{account.address}</div>
}
- To follow the framework convention (adopted by Tanstack as well) we are using the prefix "create" instead of "use". This introduces a naming confict with
useConfingand the core functioncreateConfig, for a quick workaround the core function is being renamed toinitConfig. (we can discuss this)
- [ ] Package (on process)
- [ ] Docs
- [ ] vite-solid playground (80%)
- [ ] ssr-solid playground
- [ ] tests
NOTE: This is currently under solid-no-bun folder but will later be moved to the right place.
⚠️ No Changeset found
Latest commit: 312e9d5a678597a0002552324964ed65776cd70c
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| wagmi | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Feb 5, 2024 2:17am |
New dependencies detected. Learn more about Socket for GitHub ↗︎
will refactor