# react-custom-mount

> Mount react components using custom elements

Latest version **1.1.1** (published 2023-07-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-custom-mount
pnpm add react-custom-mount
yarn add react-custom-mount
bun add react-custom-mount
```

## 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.1.1 |
| Published | 2023-07-24 |
| First published | 2023-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 39.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Borhaneddine GUEMIDI |
| Maintainers | guemidiborhane |

## Links

- npm: https://www.npmjs.com/package/react-custom-mount
- Repository: https://github.com/guemidiborhane/react-custom-mount
- npm.io page: https://npm.io/package/react-custom-mount

## Recent versions

- 1.1.1 (latest) — 2023-07-24
- 1.1.0 — 2023-07-22
- 1.0.1 — 2023-07-20
- 1.0.0 — 2023-07-20

## README

# react-custom-mount

> Mount react components using custom elements

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

## Install

```bash
npm install --save react-custom-mount
```

## Usage

```tsx
import {
    registerCustomElement,
    registerCustomElements,
    Components
} from 'react-custom-mount'

const ComponentOne = ({ myAttribute, children }) => {
    return (
        <>
            <p>Hello {myAttribute}</p>
            {children}
        </>
    )
}

const components: Components = {
    'component-one': ComponentOne
}

document.addEventListener('DOMContentLoaded', function () {
    // Register multiple components
    registerCustomElements(componenets)

    // Or one
    registerCustomElement('component-one', ComponentOne)
})
```

```html
<component-one my-attribute="hello">
    <div>
        <p>From the other side</p>
    </div>
</component-one>
```

## License

MIT © [Borhaneddine GUEMIDI](https://github.com/guemidiborhane), [Sofiane DEBBAGH](https://github.com/Redight)

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