Closed zandaqo closed 7 years ago
There's no direct JSX syntax that would allow you to tell the transform that you want to skip. Components are very close (and we'll likely skip inside them), but iDOM just added support for them.
In that case, I propose using skip
attribute of an element as the signal to call skip inside the element. That is, translating this:
<div skip></div>
into this:
elementOpen("div");
skip();
elementClose("div");
I have come up with an ad-hoc implementation in my fork, if you are interested in this approach, I can polish it up and submit a pull request.
Sure. Few points:
skip
is a valid attribute, so we let's use __skip
I have updated my commit to address those points. It now uses __skip
by default, and the attribute name can be changed by setting skipAttribute
option. Components are also skipped. Can you take a look at the code? It passes all the tests, though I'm having hard time setting up eslint, so not sure about the style.
Yah, that looks fine.
Hi,
It's a bit puzzling that this plugin doesn't support iDOM's
skip
since the feature is instrumental in creating nested components. Is there some inherent problem with JSX or iDOM that is blocking this feature? Or is there a simpler workaround imitatingskip
in JSX that I am not aware of?