GithubHelp home page GithubHelp logo

isabella232 / react-travel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fezvrasta/react-travel

0.0 0.0 0.0 125 KB

Home Page: https://souporserious.github.io/react-travel/

License: ISC License

JavaScript 95.91% CSS 0.39% HTML 3.70%

react-travel's Introduction

React Travel

npm version Dependency Status

Your subtree should be able to travel into another top-level tree.

Example

<Travel
  onMount={node => {
    return(
      $(node).dialog({
        autoOpen: false,
        close: () => {
          this.setState({dialogOpen: false})
        }
      }).data('ui-dialog')
    )
  }}
  onUpdate={dialog => {
    if(dialogOpen) {
      dialog.open()
    } else {
      dialog.close()
    }
  }}
>
  <div>
    Even works with third party dialogs!
  </div>
</Travel>

Props

to: PropTypes.any

What node the portal is rendered to, defaults to document.body.

tag: PropTypes.string

What tag to use for the portal, defaults to div.

id: PropTypes.string

React id prop.

className: PropTypes.any

React className prop.

style: PropTypes.object

React style prop. Accepts an object of styles that are applied to the portal. Note that values require their respective unit applied i.e style={{padding: '12px'}}.

children: PropTypes.element

Accepts a single React element or component.

onMount: PropTypes.func

onUpdate: PropTypes.func

onUnmount: PropTypes.func

All tie into React's life cycle methods. Returns portal node with any work done to it.

react-travel's People

Contributors

souporserious avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.