SolidJSS
SolidJSβ€’6mo agoβ€’
4 replies
siduck

How to make components with multiple global states

<Dropdown>
  <DropdownTrigger>  abc  <DropdownTrigger>
  <DropdownContent>  FLOATING DIV </DropdownContent>
</Dropdown>


So i could add onclick() for the trigger element and the content div will get toggled as per the state , but if i define state in a store.ts file then every <Dropdown> will share the same state only thing i could think of is adding id prop to each of the Dropdown* components but that sounds messy 😨
Was this page helpful?