7.0.0 • Published 5 years ago

babel-plugin-transform-jsxspreadchild v7.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

babel-plugin-transform-jsxspreadchild

Usage

.babelrc:

{
  "plugins": ["babel-plugin-transform-jsxspreadchild", "@babel/plugin-transform-react-jsx"]
}

Example

In

// @jsx h
<div>
  <a href="other.html">Link</a>
  <ul>
    {...[<li>Item A</li>, <li>Item B</li>]}
    <li>Item Last</li>
  </ul>
</div>

Out

// @jsx h
h('div', null,
  h('a', { href: 'other.html' }, 'Link'),
  h('ul', null,
    ...[h('li', null, 'Item A'), h('li', null, 'Item B')],
    h('li', null, 'Item Last')
  )
);