jsxclassnames
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

My own jsxclassnames

A light helper to generate your react classes dynamically.

How to use it

The helper will receive a number|string|obj|array|undefined|null and will return all the truthy properties.

Component

import jsxclassnames from 'jsxclassnames'

<div
  className={jsxclassnames(
    { 'test--one': true, 'other-class': 0 },
    'myclass',
    ['myotherclass', current === id],
    })}
  />

Component rendered

   <div class="test--one myclass myotherclass"></div>

Readme

Keywords

none

Package Sidebar

Install

npm i jsxclassnames

Weekly Downloads

2

Version

1.2.0

License

ISC

Unpacked Size

8.27 kB

Total Files

8

Last publish

Collaborators

  • chekuda2