ruby-hyperloop / hyper-react

The project has moved to Hyperstack!!
https://hyperstack.org/
MIT License
285 stars 14 forks source link

param ref= callbacks #239

Closed janbiedermann closed 6 years ago

janbiedermann commented 6 years ago

Ref callbacks work for dom nodes in lap18 but due to react 16 async rendering referencing components is not reliable. (There is a related bug open for this at reactjs, but it maybe doesnt get fixed.) The reason is, ref may pass a dom node correctly to the callback, but the component may not be attached yet to the dom node when passed, referencing _getOpalInstance instance may fail sometimes, sometimes not. Maybe referencing components through the dom node should be disabled?

String refs are not supported in lap18

janbiedermann commented 6 years ago

This may actually be a hyperloop issue. The component instance is attached not when the react instance is created, but later on, when componentWillMount is called.

Fix on the way.

janbiedermann commented 6 years ago

refs work for components now in lap19, strings refs still are not supported.