S
SolidJS•2mo ago
siduck

use directive not working

I was learning this https://www.solidjs.com/tutorial/bindings_directives but when i try use directive locally, it doesnt work. Do i need to enable things?
SolidJS
Solid is a purely reactive library. It was designed from the ground up with a reactive core. It's influenced by reactive principles developed by previous libraries.
12 Replies
bigmistqke
bigmistqke•2mo ago
i remember something about directives being treeshaken away by typescript. try
import {directive} from ...
// add the directive somewhere so that it will not be treeshaken away
directive
return <div use:directive={...} />
import {directive} from ...
// add the directive somewhere so that it will not be treeshaken away
directive
return <div use:directive={...} />
siduck
siduckOP•2mo ago
nvm it works but weirdly
siduck
siduckOP•2mo ago
No description
siduck
siduckOP•2mo ago
No description
siduck
siduckOP•2mo ago
if i click on the white part then it doesnt work
bigmistqke
bigmistqke•2mo ago
🤔 i m not following, you are not using a directive here?
siduck
siduckOP•2mo ago
no i used it inside my select component i meant the entire website is the red part you see so clicking the white part doesnt trigger the directive
bigmistqke
bigmistqke•2mo ago
i have too little information to help you out with that i'm afraid, if you can make a minimal reproduction in the playground of your bug i can have a look at it
siduck
siduckOP•2mo ago
No description
siduck
siduckOP•2mo ago
vanilla solid project with vite clicking the white area doesnt trigger anything, but this doesnst happen on solid playground
bigmistqke
bigmistqke•2mo ago
did u try this?
siduck
siduckOP•2mo ago
yes, same thing with it but clicking within the red area works ig this shouldnt be much of issue my site was new so nothing in it, was testing my dropdown and wanted outside click stuff for it i get it now, thanks

Did you find this page helpful?