Default behaviour to have undefined in children?
Am I expected to filter out undefined nodes in children?
I have 2 uses cases and I'm seeing undefined peppered in with other nodes.
Is this the default behaviour with solidjs?

18 Replies
For reference, this is my component:
You shouldn't have to, are you seeing issues with it?
I think those undefined are added by Mantine as you didn’t define a separator.
Nope. React only shows 3 children for the same component.

Yes, if I do not remove the undefineds the resulting markup is a complete mess.
How is
Anchor
defined?How do you mean? Also, I have 2 use cases where this shows up. For BreadCrumbs and Card. They both have children.
Like does the Anchor component return multiple elements in a fragment?
In react

I'm just not sure where the undefined is coming from 🤔 Maybe the
Box
component if you already ported that. Also, what does the markup look like with the undefined?
There are errant empty nodes:
I see. I'm guessing this is following the Mantine Breadcrumbs implementation almost 1-1 with the loop over children and creating the elements through that? My guess is the undefined is coming from the
Box
component since it does "render" 2 elements in a fragment, the first of which could be undefined. So I guess technically, it is expected
But it could also be a bug with fragments, I'm not too sure thereOk, so I did
And it shows 3 children. Looks like I need to do some debugging. Something isn't quite right. 😩
Should have done that in the beginning 😳 but when 2 components show the same thing...
It's definitely the Box component I think
This mantine port is not easy 😩 17 components verified out of 84 so far. 106 actually but waiting until I do a complete port of floating-ui. ðŸ˜
You're porting floating-ui?
You can just use the vanilla library
I'm going to use https://github.com/ptrtorain/floating-ui-solid as the base. I'll vibe code what's needed at a minimum. I already made an issue. The author will be adding in the missing functionality.
GitHub
GitHub - ptrtorain/floating-ui-solid: SolidJS bindings for Floatin...
SolidJS bindings for Floating UI. Contribute to ptrtorain/floating-ui-solid development by creating an account on GitHub.
Can't. Mantine demands a lot of functionality that is missing otherwise.
I want an as close to 1:1 port of react.