codecks-io / react-reform

Helps you create powerful themes for pleasant to use forms
http://react-reform.codecks.io
135 stars 7 forks source link

Does it works with React Native? #14

Open sospedra opened 7 years ago

sospedra commented 7 years ago

I doesn't like :/

danielberndt commented 7 years ago

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?

wangzuo commented 7 years ago

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.

danielberndt commented 7 years ago

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 :)

wangzuo commented 7 years ago

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

danielberndt commented 7 years ago

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}/>
wangzuo commented 7 years ago

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