Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Latest commit

 

History

History
30 lines (22 loc) · 668 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 668 Bytes

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