filter JSXEmptyExpression

This commit is contained in:
Amour1688 2020-05-17 21:49:08 +08:00
parent 68da671c5a
commit 063af0e975

View File

@ -14,7 +14,11 @@ const rootAttributes = ['class', 'style'];
const transformOn = (event = '') => `on${event[0].toUpperCase()}${event.substr(1)}`;
const filterEmpty = (value) => value !== undefined && value !== null;
const filterEmpty = (value) => (
value !== undefined
&& value !== null
&& !t.isJSXEmptyExpression(value)
);
/**
* Transform JSXMemberExpression to MemberExpression