ryansolid / babel-plugin-jsx-dom-expressions

A JSX to DOM plugin that wraps expressions for fine grained change detection
MIT License
60 stars 10 forks source link

Insert props.children as children if parent jsx isn't a component #31

Closed mduclehcm closed 4 years ago

mduclehcm commented 4 years ago

Fix #30

ryansolid commented 4 years ago

You are going to want a test that is dynamic wrapped as well. Like

const template3 = <module children={props.child} />;
const template3 = (function() {
  const _el$3 = _tmpl$2.cloneNode(true);

  _$insert(_el$3, () => props.child);
  return _el$3;
})();

Does the attribute trump the actual children or vice versa? Like what does this do?

const template3 = <module children={props.child}>Hello</module>;

I believe the attribute should win but should confirm.

ryansolid commented 4 years ago

Is this one ready minus tweaking the runtime? (it's non-breaking either way so I could merge sooner).