1.1.4 • Published 5 years ago

react-portal-hijacker v1.1.4

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

react-portal-hijacker

A React component that uses portals to hijack DOM nodes.

To install

npm i react-portal-hijacker

Usage

Just use the Hijacker component, passing as the prop 'nodeSelector' the class name of the element/s you want the portal to target. The children of the Hijacker component will be rendered inside the targeted node.

function App() {
  return (
    <Hijacker nodeSelector='test-div' >
      <>
        <h1>PORTAL!</h1>
        <h2>WOOOHOO</h2>
      </>
    </Hijacker>
  )
}

Overwride (new feature)

New prop type: overwride. If prop 'overwride' is present, the component inside the portal will be positioned abolutely over any previous dom elements..

function App() {
  return (
    <Hijacker nodeSelector='test-div' overwride >
      <>
        <h1>PORTAL!</h1>
        <h2>WOOOHOO</h2>
      </>
    </Hijacker>
  )
}
1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago