reactpy icon indicating copy to clipboard operation
reactpy copied to clipboard

Support `ref` prop

Open Archmonger opened this issue 2 years ago • 1 comments

Original discussion: #1134 cc: @slauko

Current Situation

With several tags such as canvas, ReactJS will "fill in" the context into the ref=... you provide. We currently do not have an equivalent feature in ReactPy. Currently, all props provided to ReactPy are serialized and sent to the client as-is.

Currently we have no mechanism that would enable ReactJS/ReactPy to intelligently "fill in" this ref. To add compatibility for this feature, ReactPy would need to start treating reactpy.html.canvas["ref"] as a unique prop.

Proposed Actions

In all likelihood, creating an equivalent API to ReactJS <canvas ref=... /> would rely on our future plans for a use_messenger hook to allow for arbitrary client->server real-time communication.

There's also a chance we develop this fully server-sided, but that's probably not technologically feasible.

Archmonger avatar Aug 25 '23 21:08 Archmonger

I second this. It would be really nice to have this feature in ReactPy as well :)

elro444 avatar Oct 03 '23 16:10 elro444