New package `@withease/refs`
igorkamyshev opened this issue · 3 comments
igorkamyshev commented
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
Kelin2025 commented
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
igorkamyshev commented
I assume, it could be done by @@unitShape
protocol in this case. However, it requires additional research.
igorkamyshev commented
I think the framework-agnostic Gate-s is the more promising feature, so let's concentrate on it.