Socket
Book a DemoInstallSign in
Socket

handsome-react

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handsome-react

empower react to be looked more handsome

latest
npmnpm
Version
0.3.2
Version published
Maintainers
1
Created
Source

#Installation

NPM

npm install handsome-react --global

Yarn

yarn global add handsome-react

#Component

Proposal

  • If
  • Switch Case
  • Try Catch

##If Make condition syntax in React Component read easier

Example

From

const Example = ({condition})=>
  <div>
    {(condition)?
      <div>True</div>:
      <div>False</div>
    }
  </div>

Into

import {If,Else} from 'handsome-react';
const Example = ({condition}) =>
  <If condition={condition}>
    <Then> <span>True</span> </Then>
    <Else> <span>False</span> </Else>
  </If>

This feature supports else if as well


const Example = ({value}) =>
  <If condition={value==1}>
    <Then> <span>True</span> </Then>
    <Elif condition={value==2}></Elif>
    <Elif condition={value==3}></Elif>
    <Else> <span>False</span> </Else>
  </If>

You can also use only if without then and else, The component will render when condition is true

const Example = ({condition}) =>
  <If condition={condition} >
    <span>True</span>
  </If>

FAQs

Package last updated on 06 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts