Closed dvshur closed 7 years ago
@tomkis could you please take a look?
I could submit a PR if you think this is a right idea.
@tomkis thank you for fixing the issue, but could you please publish the fix to npm?
@dvshur apologies, I totally forgot to publish the change. Should be fixed in prism@4.1.2
Hi,
I noticed that in current implementation of
enhanceComponent
the enhanced (inner) component receives prism-specific propsselector
andwrapper
. For me it caused a problem with a 'controlled input' component where props got passed down further by something like{ ...rest }
to native HTML tag, causing a ReactWarning: Unknown props `selector`, `wrapper` on <input> tag.
.As far as I understand, those props are only used to patch a store in
getChildContext
, and the inner component doesn't need them, so I believe they should stay in the wrappingEnhancedComponent
.Right now a render method of
enhanceComponent
looks like this:To stop passing down those props, something like this could be done instead:
What do you think about it?