SolidJSS
SolidJSโ€ข3y agoโ€ข
7 replies
aryzing

How to pass reactive values to `ref`?

For example, inside a <For> element, how would the ref handle using For's reactive index? Something like the code below (which doesn't work),

<For each={items}>
  {(_item, i) => <div ref={el => someFnThatNeedsIndex(i())}></div>}
</For>
Was this page helpful?