Closed
Description
Hi,
I am setting up some tests with mocha-webpack for my project which uses react-toolbox. Because the tests are run in node.js environment, I must use isomorphic-style-loader instead of style-loader (see webpack-contrib/style-loader#109). However, because isomorphic-style-loader adds _getCss()
and _insertCss()
to the imported style object, I get the error "theme[key].indexOf is not a function" from https://github.com/javivelasco/react-css-themr/blob/master/src/components/themr.js#L62:
theme[key] && style[key] && theme[key].indexOf(style[key]) === -1
It happens when key
is _getCss
or _insertCss
and theme[key]
is a function instead of a string. The fix is simple like this:
typeof theme[key] === 'string' && theme[key] && style[key] && theme[key].indexOf(style[key]) === -1
I think it is a safe check anyway. I can provide a PR if you want?
Metadata
Metadata
Assignees
Labels
No labels