Tiny wrapper around React.createElement with support for dumb components and null.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.editorconfig
.gitignore
LICENSE
README.md
package.json
tsconfig.json

README.md

React Render Component

Tiny wrapper around React.createElement with support for dumb components and null.

Install

$ npm install --save react-render-component

Usage

import * as React from 'react';
import renderComponent from 'react-render-component';

renderComponent ( null ); // Not supported by React.createElement
renderComponent ( <div>I'm dumb</div> ); // Not supported by React.createElement
renderComponent ( 'a', { href: '#' }, 'link' );
renderComponent ( () => <div>Stateless</div> );
renderComponent ( class extends React.Component {
  render () {
    return <div>Class</div>
  }
});

License

MIT © Fabio Spampinato