Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doesdev/snabbdom-safe-props
Snabbdom replacement module for 'props' with unsupported 'type' protection
https://github.com/doesdev/snabbdom-safe-props
Last synced: about 20 hours ago
JSON representation
Snabbdom replacement module for 'props' with unsupported 'type' protection
- Host: GitHub
- URL: https://github.com/doesdev/snabbdom-safe-props
- Owner: doesdev
- License: mit
- Created: 2016-03-09T14:33:32.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-26T23:19:06.000Z (over 7 years ago)
- Last Synced: 2024-10-29T20:53:16.479Z (21 days ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# snabbdom-safe-props
Snabbdom replacement for default module 'props' with unsupported 'type' protection.
This simply adds a try/catch if the property being updated is `type`, as unsupported
types will cause the browser to throw an exception.### Usage
Install:
`npm i snabbdom-safe-props --save`
Use:
```javascript
var patch = snabbdom.init([
require('snabbdom-safe-props') // Instead of require('snabbdom/modules/props')
]);
```### The props module
Allows you to set properties on DOM elements.
```javascript
h('a', {props: {href: '/foo'}}, 'Go to Foo');
```