react-reform icon indicating copy to clipboard operation
react-reform copied to clipboard

Does it works with React Native?

Open sospedra opened this issue 7 years ago • 6 comments

I doesn't like :/

sospedra avatar Jan 05 '17 18:01 sospedra

I actually haven't tried it with react native yet. But I'm fairly optimistic that this library could work quite well in this use case since there's no dependency on ReactDOM and no html tags are being used. Except of course for the <form> tag. Any ideas or suggestions how forms are treated in React Native?

Also: have you tried embedding it in a react native library? What kind of errors did you get?

danielberndt avatar Jan 06 '17 08:01 danielberndt

I have made some small tweaks of reform to make it work on react-native. Maybe we can come up with sth like react-reform-native, really like the idea of themes.

wangzuo avatar Jan 12 '17 14:01 wangzuo

Very cool! Can you share a gist or something like that so I can see what changes you've made to make it work?

Definitely awesome stuff! 👍 And I absolutely can imagine supporting react native in some shape or form :)

danielberndt avatar Jan 12 '17 14:01 danielberndt

Sure https://gist.github.com/wangzuo/91e997a118a3d5e632823eddb5655948

wangzuo avatar Jan 12 '17 14:01 wangzuo

Ah great! That's indeed very few necessary changes! Maybe it's not even necessary to create a separate react-reform-native library. Maybe it's enough to use the <ReformContext> which allows to pass a formContainerComponent prop. (it's "form" by default). And for react-native projects you simply use

<ReformContext formContainerComponent={View}/>

danielberndt avatar Jan 12 '17 16:01 danielberndt

Yes, but there is also no event system on react native

wangzuo avatar Jan 13 '17 02:01 wangzuo