@rcp/util.createmount
v2.0.0
Published
The utility for creating mountable view
Downloads
11
Readme
@rcp/util.createmount
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 inopen
function (optional, defaultdocument.body
)opts.attributes
any? attributes fallback inopen
functionopts.element
ReactElement<P>? element fallback inopen
function
Returns IMountCenter
Related
Authors
This library is written and maintained by imcuttle, mailto:[email protected].
License
MIT