Pass ref to a custom component from visual editor

Hello @luigiveoworld,

What you might be looking for is using our <StateProvider> component so that you can access this reference on state within the Builder Block context.

function hitHOC({ children, hits }: { children?: JSX.Element; hits: any }) {
  return <StateProvider state={{ hits }}>{children}</StateProvider>;
}

// Pass all hits back to any item
export const AlgoliaHitsWrapper = connectHits(hitHOC);

More detail here: Component with bindings from plugin - #2 by steve

I have not tried this with a ref yet, but I might be able to create an example quick.