react-portal-decorator

0.1.1 • Public • Published

react-portal-decorator

CircleCI

A simple way to render a component into a portal in React
npm install --save react-portal-decorator
import React, { Component } from 'react';
import inPortal from 'react-portal-decorator';
 
@inPortal('render-div-id')
class MyComponent extends Component {
    return (
        <div>
            Hello, world!
            <br />
            This will be in the div '#render-div-id'
        </div>
    );
}

The decorator works by creating a higher-order component that renders your component into a div with the id specified when calling the decorator

Readme

Keywords

none

Package Sidebar

Install

npm i react-portal-decorator

Weekly Downloads

1

Version

0.1.1

License

ISC

Unpacked Size

8.3 kB

Total Files

10

Last publish

Collaborators

  • keegandonley