igorkamyshev/withease

New package `@withease/refs`

igorkamyshev opened this issue · 3 comments

Use-case

const mapContainer = createRef()

// react component
function Map() {
  const ref = useUnit(mapContainer)

  return <div ref={ref} />
}

// solid component
function Map() {
  const ref = useUnit(mapContainer)
 
  return <div ref={ref />
}

// Store mapContainer.$current
// Event mapContainer.next

It can be used in UI-libs thru @@unitShape protocol which nave to return next Event.

сс @Kelin2025

Should we call it @withease/react-refs, or @withease/refs/react, or what? Would be useful for other view libraries, but after effector-factorio I'm not sure how to solve it better

I assume, it could be done by @@unitShape protocol in this case. However, it requires additional research.

I think the framework-agnostic Gate-s is the more promising feature, so let's concentrate on it.