# react-sanitize-dom-props

> This package helps to remove extra properties from object and leave only ones that are valid for passing to dom.

Latest version **0.0.1** (published 2020-10-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-sanitize-dom-props
pnpm add react-sanitize-dom-props
yarn add react-sanitize-dom-props
bun add react-sanitize-dom-props
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2020-10-22 |
| First published | 2020-10-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 138 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Temuri Mikava |
| Maintainers | thomasmikava |

## Links

- npm: https://www.npmjs.com/package/react-sanitize-dom-props
- Repository: https://github.com/thomasmikava/react-sanitize-dom-props
- Homepage: https://github.com/thomasmikava/react-sanitize-dom-props.git
- Issues: https://github.com/thomasmikava/react-sanitize-dom-props/issues
- npm.io page: https://npm.io/package/react-sanitize-dom-props

## Recent versions

- 0.0.1 (latest) — 2020-10-22

## README

# React Sanitize DOM Props

This package helps to remove extra properties from object and leave only ones that are valid for passing to dom.

### Usage

```js
import { pickHTMLProps } from "react-sanitize-dom-props";
const props = {
    onClick: () => {},
    className: "container",
    foo: "bar"
}

const sanitizedPorps = pickHTMLProps(props, /* strict */ false);
/* {
    onClick: () => {},
    className: "container",
} */
```


```js
import { isValidHTMLProp } from "react-sanitize-dom-props";

isValidHTMLProp("onClick" /* strict */ false); // true
isValidHTMLProp("onClick" /* strict */ true); // true
isValidHTMLProp("onclick" /* strict */ false); // true
isValidHTMLProp("onclick" /* strict */ true); // false
```

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