S
SolidJS15mo ago
Mr Void

Is the following a "clean" way of handling modals?

I'm trying to figure out a "clean", "best-practice" way of handling modals in an app. Have been experimenting in the following playground: https://playground.solidjs.com/anonymous/d3e943ee-e2fd-48e8-87ce-76d271f72b23 Please take a look and let me know if you have any feedback, or what your thoughts are regarding this
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
2 Replies
foxpro 🐍
foxpro 🐍15mo ago
This is fine
Jakob
Jakob15mo ago
I'd do it with <Dynamic>: https://playground.solidjs.com/anonymous/cff5c54d-ef76-4a82-8f96-3c9011760bf7 that way you reduce code duplication and each modal doesnt have to be wrapped in <Show> and maybe with props so the parent is responsible for managing state: https://playground.solidjs.com/anonymous/631dd352-3ea6-409b-82c8-ea42d4c6ddef
Want results from more Discord servers?
Add your server