From 2a659dfc1226df0c3281e29b2d422f4d5e4ca546 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Tue, 8 Oct 2019 17:17:18 -0400 Subject: [PATCH] fix: false positive on createElement --- src/features/css-prop.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/features/css-prop.js b/src/features/css-prop.js index c8af6f99..a6c5f757 100644 --- a/src/features/css-prop.js +++ b/src/features/css-prop.js @@ -168,7 +168,11 @@ export default { const propsPath = path.get('arguments')[1]; const innerState = { pluginOptions, file, processed: false, typeName }; - propsPath.traverse(cssPropertyVisitors, innerState); + + // We aren't checking very hard that this is a React createElement call + if (propsPath) { + propsPath.traverse(cssPropertyVisitors, innerState); + } if (innerState.processed) { const { jsx } = state[JSX_IDENTS];