# mount-components

> Programmatically mounting and displaying components.

Latest version **1.0.2** (published 2022-12-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install mount-components
pnpm add mount-components
yarn add mount-components
bun add mount-components
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-12-29 |
| First published | 2022-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | PlatzerT |
| Maintainers | chbb |

## Links

- npm: https://www.npmjs.com/package/mount-components
- Repository: https://github.com/PlatzerT/mount-components
- Homepage: https://github.com/PlatzerT/mount-components#readme
- Issues: https://github.com/PlatzerT/mount-components/issues
- npm.io page: https://npm.io/package/mount-components

## Recent versions

- 1.0.2 (latest) — 2022-12-29
- 1.0.1 — 2022-12-29
- 1.0.0 — 2022-12-29

## README

# mounted-components

> Programmatically mounting and displaying components.

[![NPM](https://img.shields.io/npm/v/mounted-components.svg)](https://www.npmjs.com/package/mounted-components) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save mounted-components
```

## Usage

```jsx
import React from "react";
import { useMount, MountRoot } from "mount-components";

const Modal = ({ close, content }) => {
  return (
    <div>
      {content}
      <button onClick={close}>close</button>
    </div>
  );
};

const App = () => {
  const { open } = useMount();
  function onClick(e) {
    open(Modal, {
      content: "This is a modal!",
    });
  }
  return (
    <div>
      <button onClick={onClick}>Open</button>
      <MountRoot />
    </div>
  );
};
export default App;
```

## License

MIT © [PlatzerT](https://github.com/PlatzerT)

---
_Source: https://npm.io/package/mount-components · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
