Skip to content

Commit

Permalink
Eliminate invalid props in span tag
Browse files Browse the repository at this point in the history
  • Loading branch information
kuy committed Sep 16, 2016
1 parent 5d2e9d8 commit f265517
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"react-component"
],
"dependencies": {
"blacklist": "^1.1.4",
"dompurify": "^0.8.3",
"is-dom": "^1.0.5",
"redux-actions": "^0.12.0"
Expand Down
8 changes: 5 additions & 3 deletions src/origin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { Component, PropTypes } from 'react';
import { connect } from 'react-redux';
import blacklist from 'blacklist';
import { show, hide, delay } from './actions';

class Origin extends Component {
Expand Down Expand Up @@ -31,7 +32,9 @@ class Origin extends Component {
delayOn: PropTypes.oneOf(['show', 'hide', 'both']),
onTimeout: PropTypes.func,
onMouseEnter: PropTypes.func,
onMouseLeave: PropTypes.func
onMouseLeave: PropTypes.func,
onHover: PropTypes.func,
onLeave: PropTypes.func
};
}

Expand Down Expand Up @@ -74,8 +77,7 @@ class Origin extends Component {
}

render() {
const props = { ...this.props };
delete props['dispatch'];
const props = blacklist(this.props, 'name', 'content', 'place', 'tagName', 'delay', 'delayOn', 'dispatch', 'onTimeout', 'onHover', 'onLeave');

if (!props.onMouseEnter) {
props.onMouseEnter = e => {
Expand Down

0 comments on commit f265517

Please sign in to comment.