0.1.1 • Published 3 years ago

babel-plugin-jsx-wrap-if v0.1.1

Weekly downloads
100
License
MIT
Repository
github
Last release
3 years ago

babel-plugin-jsx-wrap-if

Conditional wrapping for React

Usage

In your babel.config.js file add:

plugins: [
  ...
  'jsx-wrap-if'
]

In your JSX file:

<blockquote wrap-if={condition}>Wrapped text</blockquote>

When condition is false:

Wrapped text

When condition is true:

<blockquote>Wrapped text</blockquote>

License

MIT