From e51747934ec5bac0c267dcc61d55be930bbb3088 Mon Sep 17 00:00:00 2001 From: Andreas Deuschlinger Date: Wed, 28 Mar 2018 16:33:35 +0200 Subject: [PATCH] start adding prop blacklist --- src/js/with-react.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/js/with-react.jsx b/src/js/with-react.jsx index ddb7c3a182..1c286a334b 100644 --- a/src/js/with-react.jsx +++ b/src/js/with-react.jsx @@ -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 @@ -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; }