7.0.0 • Published 4 years ago

@rocketstation/black-box v7.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Black Box

Black Box is a lightweight & powerful tool based on React & Fela. It combines behavior, presentation, structure in one place

Installation

npm i --save @rocketstation/black-box

Usage

import $ from '@rocketstation/black-box'

const MyComponent = ({ name, ...props }) =>
  $(
    'div',
    {
      onClick: () => { console.log('test') },
      skin: {
        backgroundColor: 'black',
        color: 'white',
      },
      ...props
    },
    'Hello',
    $('span', name),
    '!'
  )

ReactDOM.render(
  $(MyComponent, { name: 'John Doe' }),
  document.getElementById('app')
)

Reserved Props

skin - if it is object or function, it will be removed from props & passed to Fela.combineRules

key - will be passed to the root component

Motivation

BlackBox adds extra configuration to React.createElement

Why not to use JSX

JSX is not JS. It tries to combine HTML & JS syntax inside JS. It limits JS features & adds new language hacks & overheads. Moreover, JSX requires closing tags

License

Black Box is licensed under the MIT License

Created by RocketStation

7.0.0

4 years ago

6.7.0

4 years ago

6.6.0

5 years ago

6.4.0

5 years ago

6.3.1

5 years ago

6.3.0

5 years ago

6.2.1

5 years ago

6.2.0

5 years ago

6.1.0

5 years ago

6.0.1

5 years ago

6.0.0

5 years ago

5.0.2

5 years ago

5.0.1

5 years ago

5.0.0

5 years ago

4.0.4

5 years ago

4.0.3

5 years ago

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

3.1.2

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.0

6 years ago

1.2.1

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

1.0.1

6 years ago