Closed gcanti closed 8 years ago
To be honest, this dependency was not bothering me a lot, but it is always nice to have dependencies more pluggable (and optional). I think your solution is very good.
Also this open up the possibility to use UVDOM systems other than
uvdom
.
Until some UVDOM specification gains traction (I wish you luck with uvdom
) and community starts to produce good number of quality components for it, I consider React as UVDOM. :) But it is always nice to be prepared for that, as tcomb-form will be.
remove uvdom dependency from core
This is a follow up of https://github.com/gcanti/tcomb-form/issues/31#issuecomment-157165597
I agree with @Xananax and I'm willing to remove the uvdom dependency from the core. However I'm trying to avoid unnecessary breaking changes so I came up with this proposal.
In order to be consumed by React a template must be a function with the following signature
Obviously
template
can be factored out towhere
Making every tcomb-form factory handle an (optional)
toReactElement
static function attached to the template, I could drop the uvdom dependency from the core of tcomb-form without bracking changes (i.e. people using the uvdom returned by the current bootstrap templates). Also this open up the possibility to use UVDOM systems other thanuvdom
.Example
I'd love to hear your feedback
/cc @minedeljkovic