#How to mount and unmount solidjs component manually?
23 messages · Page 1 of 1 (latest)
createRoot but care to eloborate? should be simple to just use <Show/>
let dispose
let result = createRoot(d => {
dispose = d
return <Comp />
})
i'd bet there's some utility function in solid primitives
if you want to look
Here is the API, I want to use solidjs in such APIs.
hmm, yeah, you can use above snippet then
is this kinda a vanilla-ish?
render would work too
from the looks of the api
I'm developing obsidian plugin.
Here is the full APIs : https://github.com/obsidianmd/obsidian-api/blob/master/obsidian.d.ts
how are currently mounting solid component?
It works now. Thank you!
yeah, here's how with render
const dispose = render(() => <C />, node)
but yeah, you'd need a container as dispose wipes out the container iirc
yeah, it looks good to me. solid makes it easy to develop plugin UI.
I'll migrate my project to solid.
https://github.com/mokeyish/obsidian-enhancing-export/tree/master/src/ui
This is an enhancing export plugin base on Pandoc for Obsidian (https://obsidian.md/ ). It's allow you to export to formats like Markdown、Markdown (Hugo https://gohugo.io/ )、Html、docx、Latex...
i wonder why i rarely see node.remove() when it comes to removing a node
most code just does the same thing as this, even solid internals use this
I'm not sure if solid will automatically remove node. I'll test it later.
the code is correct, i'm saying node.parent.removeChild(node) vs node.remove()
Thread was archived by YiiSh. Anyone can send a message to unarchive it.