This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

react-if-elseif-else-render

1.0.2 • Public • Published

React If Elseif Else Render

This package is for reactjs to use 'if elseif else' in render function

Installation

npm

npm install react-if-elseif-else-render

yarn

yarn add react-if-elseif-else-render

Example

import { If, Then, ElseIf, Else } from 'react-if-elseif-else-render';
 
class Example extends Component {
 
  render() {
    var i = 3; // it will render '<p>Else</p>'
    return (
      <If condition={== 1}>
        <Then>
          <p>Then: 1</p>
        </Then>
        <ElseIf condition={== 2}>
          <p>ElseIf: 2</p>
        </ElseIf>
        <Else>
          <p>Else</p>
        </Else>
      </If>
    );
  }
}
 

Install

npm i react-if-elseif-else-render

DownloadsWeekly Downloads

181

Version

1.0.2

License

MIT

Last publish

Collaborators

  • ericping