2.0.0 • Published 2 months ago

@rcp/util.createmount v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
2 months ago

@rcp/util.createmount

NPM version NPM Downloads

The utility for creating mountable view

Installation

npm install @rcp/util.createmount
# or use yarn
yarn add @rcp/util.createmount

Usage

import createMount from '@rcp/util.createmount'
const center = createMount({
  // default's opts in `open` function
})

// The `element` would be mounted on `mountNode`
// and `attributes` is the container node's attributes
center.open({
  element: <div>hahahaha</div>,
  attributes: {
    id: 'container',
    className: 'i-container'
    style: {
      position: 'absolute'
    }
  },
  mountNode: document.body
})

API

createMountCenter

Parameters

  • opts IMountOptions<P>
    • opts.mountNode Node mountNode fallback in open function (optional, default document.body)
    • opts.attributes any? attributes fallback in open function
    • opts.element ReactElement<P>? element fallback in open function

Returns IMountCenter

Related

Authors

This library is written and maintained by imcuttle, moyuyc95@gmail.com.

License

MIT

2.0.0

2 months ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.14

4 years ago

1.0.12

4 years ago

1.0.10

4 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago