0.0.5 • Published 8 years ago

jsx-utils v0.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

jsx-utils

Some utils make your react jsx code better.

Usage

npm install jsx-utils --save

then follow the example below.

Util list

merge style

This is a useful tool for write inline styles.

Example:

var {ms} = require('jsx-utils');
...
<Button
  style={ms(
    styles.button,
    this.state.disabled && styles.disabled,
    this.state.hover && !this.state.disabled && styles.hover
  )}
/>

multi return

This is a useful tool for return many component.

Example:

var {mr} = require('jsx-utils');
...
<View>
  {mr(
    true && this.state.showViewText,
    <View />,
    <Text />
  )}
</View>

classnames

Look at: https://github.com/JedWatson/classnames

Example:

var {classnames} = require('jsx-utils');
// to do something

License

MIT

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

9 years ago