Passing undefined
to css
prop breaks composition, no EmotionCssPropInternal inserted
#1529
Labels
undefined
to css
prop breaks composition, no EmotionCssPropInternal inserted
#1529
Current behavior:
When
undefined
is provided as the value for acss
prop, Emotion does not insert theEmotionCssPropInternal
or theContext.Consumer
or provide aclassName
prop, but instead passes alongcss
as a prop.I suspect that internally Emotion is checking for
css
being defined onprops
rather than checkingprops.hasOwnProperty("css")
or similar.To reproduce:
Here's a reproduction/example in CodeSandbox
Pertinent information:
css
prop is passedundefined
.css
prop is set.Expected behavior: The
div
element should receive aclassName
prop with thecolor: red
styles, but becauseprops
contains acss
property, thecss
declaration is overwritten.Environment information:
react
version: 16.8.x–16.10.0emotion
version: 10.0.17The text was updated successfully, but these errors were encountered: