react-teleport-me

0.2.2 • Public • Published

react-teleport-me

React component to teleport component render to body.

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install react-teleport-me --save

Usage

import Teleport from 'react-teleport-me';
 
class App extends Component {
    render = () => {
        const {
            active,
        } = this.props;
 
        return active ? (
            <Teleport>
                <section
                    className="app">
                    Hello There
                </section>
            </Teleport>
            ) : null;
    }
}

You can set the lockBody property to true to add the zvui_teleport-lock class to the body. Scroll position and body properties to block scroll will be handled automatically

Dependencies

Dev Dependencies

License

MIT

Generated by package-json-to-readme

/react-teleport-me/

    Package Sidebar

    Install

    npm i react-teleport-me

    Weekly Downloads

    3

    Version

    0.2.2

    License

    MIT

    Last publish

    Collaborators

    • sylvester.aswin