Skip to content

justinwoo/react-cond

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Cond Build Status

Render components conditionally using pairs of [boolean, Component].

Usage

Install this package to your project.

Use CommonJS:

var Cond = require('react-cond');

var YourComponent = React.createClass({
  render: function () {
    <div>
      <Cond className="my-conditions">
        {3 === 3} <h1>Conditionals in my JSX?</h1>
        {1 !== 1} <h3>pls no</h3>
        {2 !== 1} YASSSSSSS
        {1 === 1} <p>医食同源</p>
      </Cond>
    </div>
  }
});

Demo

JSFiddle: http://jsfiddle.net/606xh7z7/

About

Conditional rendering component for React

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published