babel-plugin-mjsx icon indicating copy to clipboard operation
babel-plugin-mjsx copied to clipboard

Passing attributes or children to a component

Open brlewis opened this issue 8 years ago • 4 comments

babel-plugin-mjsx does not seem to have the feature msx has:

Passing attributes or children to a component will generate a call to Mithril's m.component() function, with children always being passed as an Array

Some code that worked with msx compiled with babel-plugin-mjsx but an array of children was not rendered.

brlewis avatar Nov 03 '16 21:11 brlewis

Could you provide an example of something that works with msx, but fails with babel-plugin-mjsx?

Naddiseo avatar Nov 03 '16 22:11 Naddiseo

In ProductList the ProductCard children don't render.

msx.zip

brlewis avatar Nov 04 '16 00:11 brlewis

@brlewis, could you provide a more minimal test case? Perhaps create a failing testcase for babel-plugin-mjsx.

Naddiseo avatar Nov 04 '16 16:11 Naddiseo

Having created a metalsmith plugin that calls msx directly, this issue is no longer blocking me; can't promise a concise test case soon. But I think this is similar to https://github.com/insin/msx/issues/10

brlewis avatar Nov 04 '16 19:11 brlewis