infact

0.0.1 • Public • Published

infact

This package lets you choose between importing React or Inferno, based on your BABEL_ENV

Usage:

// process.env.BABEL_ENV == 'react' || process.env.BABEL_ENV == 'inferno'
 
import { React, ReactDOM, Inferno, PropTypes, Component } from 'infact'
 
class MyComponent extends Component {
  render () {
    if (process.env.BABEL_ENV == 'react') {
      // react specific code
    }
    if (process.env.BABEL_ENV == 'inferno') {
      // inferno specific code
    }
 
    return (
      <div>
        Common code for both
      </div>
    )
  }
}

/infact/

    Package Sidebar

    Install

    npm i infact

    Weekly Downloads

    2

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • mariusandra