Skip to content

Commit

Permalink
start adding prop blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyOGo committed Mar 28, 2018
1 parent a5c6974 commit e517479
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/js/with-react.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import dasherize from './dasherize';
import on from './on';

const PROP_BLACKLIST = [
'children', // children are never passed as props, instead as real DOM children
'style', // @todo: discuss if we need style, cause we normally use BEM
];

/**
* Provides a partially applied function which let's you wrap any WebComponent with React.
* - it supports first-class props for web components
Expand Down Expand Up @@ -48,7 +53,7 @@ const withReact = (React, { pure = true } = {}) => (WebComponent) => {
const { wcNode } = this;

Object.keys(props).forEach((key) => {
if (key === 'children' || key === 'style') {
if (PROP_BLACKLIST.indexOf(key) !== -1) {
return;
}

Expand Down

0 comments on commit e517479

Please sign in to comment.