1.0.0 • Published 8 years ago
is-react-prop v1.0.0
Is React Prop?
Usage
Recommended way
This way checkAttr has no overhead for initialalization and no lists of dom-elements.
It's also more accurate, because it detects available property for the element.
import checkAttr from 'is-react-prop/checkAttr'
console.log(checkAttr('div', 'data-name')) // true
console.log(checkAttr('button', 'onClick')) // true
console.log(checkAttr('div', 'target')) // false
console.log(checkAttr(document.createElement('input'), 'onChange')) // trueisReactProp
But you can also use isReactProp like this:
import isReactProp from 'is-react-prop'
console.log(isReactProp('data-name')) // true
console.log(isReactProp('onClick')) // true
console.log(isReactProp('unknownProp')) // falseHow it works?
is-react-prop detects available property in runtime on the client, and it has minimum usage of whitelists. That's why this package is very lightweight and accurate.
So it uses whitelists on the server side just for SSR.
1.0.0
8 years ago
1.0.0-beta.5
8 years ago
1.0.0-beta.4
8 years ago
1.0.0-beta.3
8 years ago
1.0.0-beta.2
8 years ago
1.0.0-beta.1
8 years ago
1.0.0-beta.0
8 years ago
0.1.4-0
8 years ago
0.1.3
9 years ago
0.1.2
9 years ago
0.1.1
9 years ago
0.1.0
9 years ago
0.0.3
9 years ago
0.0.2
9 years ago
0.0.1
9 years ago