Closed geminiyellow closed 6 years ago
Try React Native DOM instead?
React Native Web is not fully compatible with React Native.
The RN docs cover event.persist. It's for retaining reference to the event after the handler has executed. As when you're referencing it asynchronously in e.g. InteractionManager.runAfterInteractions
@idibidiart thanks for you reply,
i dont want to use React Native DOM, because it still has a big WARNING.
if i want to use your lib in rn4w, how to fix this?
Probably just remove e.persist() but no guarantee that anything will work. The Web and RN environments are very different. Does RNW even have InteractionManager API? if not, maybe use requestIdleCallback()
No idea. There is really no intent to support RNW.
I'd be curious how this could be hooked up to RNW, but as idibidiart mentioned, the event callbacks in the web world are very different from RN. I believe persist()
relies on the Yoga layout engine which react-native-dom has implemented in WebAssembly. Someone would need to map the web DOM event callbacks to the equivalent RN analogues, but not sure if that's feasible.
ok, give up use this library. thanks your great work.
@idibidiart I'm taking another look at react-native-web since progress on react-native-dom has stalled. How feasible do you feel it would be to shim this for use with react-native-web ?
@peacechen
I've never worked with RNW but things like runAfterInteraction etc don't exist in the browser although they can be replaced with things like requestIdleCallback....
I've been working on something completely different so I don't know if I'll ever get back to RN and it looks like Flutter is gaining ground and has better behavior on Android
Sorry I couldn't be of more help
@idibidiart hi,
i want to use it with react-native-web, but looks like have same error when render children.
in here : https://github.com/idibidiart/react-native-responsive-grid/blob/1a9fdd10bf871fb8fb5314783ebd8c88650b27ed/src/components/Grid.js#L47
and i check the react-native docs,
https://facebook.github.io/react-native/docs/view.html#onlayout
{nativeEvent: { layout: {x, y, width, height}}}
on
persist
here.could you tell me why use this func?