emotion: Invalid value for prop `css` on tag when running Jest Current behavior:
When running tests via Jest, I receive the following warning dozens of times in our output:
Warning: Invalid value for prop `css` on <div> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://fb.me/react-attribute-behavior
in div (at DrawerLayout.js:59)
in DrawerContentGroup (at OrgIntegrationFacebookDrawer.js:38)
in div (at DrawerLayout.js:49)
in DrawerBody (at OrgIntegrationFacebookDrawer.js:36)
in div (at DrawerLayout.js:17)
in DrawerLayout (at OrgIntegrationFacebookDrawer.js:34)
in div (at DrawerComponent.js:21)
in div (created by ForwardRef(Paper))
in ForwardRef(Paper) (created by WithStyles(ForwardRef(Paper)))
in WithStyles(ForwardRef(Paper)) (created by Transition)
in Transition (created by ForwardRef(Slide))
in ForwardRef(Slide) (created by ForwardRef(Drawer))
in div (created by ForwardRef(Drawer))
in ForwardRef(Drawer) (created by WithStyles(ForwardRef(Drawer)))
in WithStyles(ForwardRef(Drawer)) (at DrawerComponent.js:13)
in DrawerComponent (at OrgIntegrationFacebookDrawer.js:33)
in OrgIntegrationFacebookDrawer (at OrgIntegrationFacebookDrawer.test.js:39)
in DrawerProvider (at OrgIntegrationFacebookDrawer.test.js:38)
To reproduce:
The pertinent part of the code is here:
const DrawerLayout = ({ children, ...otherProps }) => (
<div css={styles} {...otherProps} data-testid="drawer-layout">
{children}
</div>
);
Expected behavior:
I would expect that the CSS prop shouldn’t throw an Unknown Prop warning: https://reactjs.org/warnings/unknown-prop.html
Environment information:
react version: 16.9.0
react-dom version: 16.9.0
emotion-core version: 10.0.27
emotion version: 10.0.27
jest version 23.6.0,
jest-emotion version 10.0.7a
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 6
- Comments: 16 (7 by maintainers)
Most upvoted comments
Current behavior: When running tests via Jest, I receive the following warning dozens of times in our output:
Warning: Invalid value for prop `css` on <div> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://fb.me/react-attribute-behavior
in div (at DrawerLayout.js:59)
in DrawerContentGroup (at OrgIntegrationFacebookDrawer.js:38)
in div (at DrawerLayout.js:49)
in DrawerBody (at OrgIntegrationFacebookDrawer.js:36)
in div (at DrawerLayout.js:17)
in DrawerLayout (at OrgIntegrationFacebookDrawer.js:34)
in div (at DrawerComponent.js:21)
in div (created by ForwardRef(Paper))
in ForwardRef(Paper) (created by WithStyles(ForwardRef(Paper)))
in WithStyles(ForwardRef(Paper)) (created by Transition)
in Transition (created by ForwardRef(Slide))
in ForwardRef(Slide) (created by ForwardRef(Drawer))
in div (created by ForwardRef(Drawer))
in ForwardRef(Drawer) (created by WithStyles(ForwardRef(Drawer)))
in WithStyles(ForwardRef(Drawer)) (at DrawerComponent.js:13)
in DrawerComponent (at OrgIntegrationFacebookDrawer.js:33)
in OrgIntegrationFacebookDrawer (at OrgIntegrationFacebookDrawer.test.js:39)
in DrawerProvider (at OrgIntegrationFacebookDrawer.test.js:38)
To reproduce: The pertinent part of the code is here:
const DrawerLayout = ({ children, ...otherProps }) => (
<div css={styles} {...otherProps} data-testid="drawer-layout">
{children}
</div>
);
Expected behavior: I would expect that the CSS prop shouldn’t throw an Unknown Prop warning: https://reactjs.org/warnings/unknown-prop.html
Environment information:
reactversion: 16.9.0react-domversion: 16.9.0emotion-coreversion: 10.0.27emotionversion: 10.0.27jestversion 23.6.0,jest-emotionversion 10.0.7a
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 6
- Comments: 16 (7 by maintainers)
My project has worked well with the following setup.
Environment information: