🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Book a DemoInstallSign in
Socket

react-if-else

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-if-else

If/Else rendering components for React

1.1.1
latest
Source
npm
Version published
Weekly downloads
5
66.67%
Maintainers
2
Weekly downloads
 
Created
Source

React If/Else

build status npm version

Render blocks of components using a conditional, and supply to display other blocks. Also supports using conditions to display blocks (you may consider using React-Cond instead for this case).

Usage

Install this package to your project.

Use CommonJS:

var If = require('react-if-else').If;
var ElseIf = require('react-if-else').ElseIf;
var Else = require('react-if-else').Else;

var YourComponent = React.createClass({
  render: function () {
    <div>
      <If cond={true} className="my-conditions">
        If true~~~
        <h2>圌女さん募集䞭</h2>
      <ElseIf cond={false} className="my-conditions-else-if"/>
        ElseIf true~~~
        <h4>逢いたくなったらたぶたを閉じる</h4>
      <Else className="my-conditions-else"/>
        If false~~~
        <h3>出䌚いの数だけで別れは増える</h3>
      </If>
    </div>
  }
});

Demo

JSFiddle: http://jsfiddle.net/tkpx7L6a/

FAQs

Package last updated on 22 Jul 2016

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