Comments (6)
I would have to say createUniqueId
isn't the origin of the issue, it is where Toaster
is used. Would be interesting to see how you are using the Toaster
component and let's figure out how to solve it.
from terracotta.
After debugging this further, the issue seems to be that the Toaster
is being used under a MyContext.Provider
, which is created from a context.
Here is what the code looks like:
import { Toaster } from "solid-headless"
import { createContext } from "solid-js"
interface MyContextType {
myMethod: () => void
}
const defaultMyContext = {
myMethod: () => {
}
}
const MyContext = createContext<MyContextType>(defaultMyContext);
export function MyToasterProvider(props) {
const myMethod = () => {
// doing things
};
return (<MyContext.Provider
value={{
myMethod
}}
>
{props.children}
<Toaster/>
</MyContext.Provider>)
}
from terracotta.
I don't expect this to produce the issue either. Probably related to the siblings or the parent of MyToasterProvider
from terracotta.
I'm also seeing this error when trying to render a RadioGroup
with Solid and Astro. When I change the directive on the Solid component from client:load
to client:only
the component works, meaning there is an issue with server-side rendering these components.
from terracotta.
I've experienced this myself so I think I've already found the exact issue as to why this happens.
Apparently Astro will mistakenly load SolidJS twice (due to Vite's module resolution) so it will think that solid-headless components were being rendered outside of a SolidJS root. I don't know how to fix this exactly, because I'm convinced that this is either an Astro issue or a Vite issue.
from terracotta.
I've created a relevant issue thread at Astro: withastro/astro#6709
I've still yet to reproduce this issue in SolidStart
from terracotta.
Related Issues (20)
- Popover but without the close on blur HOT 6
- Combobox HOT 6
- Popover transition enter doesn't work. HOT 3
- Missing `Tab.Panels` component HOT 4
- Issue when using solid-headless with Astro HOT 5
- Modal allows background text selection & scroll HOT 6
- Usage with Islands? HOT 6
- Can you add some installation instructions please? HOT 1
- `HTMLElement is not defined` when using SSR, render function & `createResource` HOT 1
- Do you have alternative for headlessUI Switch? HOT 1
- Can we have example for select please? HOT 1
- Menu components that are difficult to understand
- Hide PopoverPanel on href/link click HOT 1
- listbox with multiple prop unable to unselect option HOT 1
- What do I use instead of Fragment? HOT 1
- Add docs please, trying to add checkbox, nothing gets shown HOT 2
- Can't use with solid start HOT 6
- 1.0 release
- TypeError: Cannot read properties of undefined (reading 'matches') HOT 2
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 terracotta.