Skip to content

Commit

Permalink
Fix for apentle layout with css-class
Browse files Browse the repository at this point in the history
  • Loading branch information
doanndd committed Sep 19, 2016
1 parent e1982b6 commit c614cb8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "babel-plugin-react-native-layout",
"version": "0.1.2",
"version": "0.1.3",
"description": "Dynamic layout for react native components",
"main": "lib/index.js",
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,14 @@ module.exports = function ({types: t}) {
var statement = body[i];
if (statement.type === 'ExpressionStatement' && statement.expression.type === 'JSXElement') {
component = false;
// Fix for apentle layouts with css-class
// istanbul ignore next
if (path.opts.JSXOpeningElement !== undefined && path.opts.JSXAttribute !== undefined) {
path.traverse({
JSXOpeningElement: path.opts.JSXOpeningElement,
JSXAttribute: path.opts.JSXAttribute,
});
}
transformLayout(statement);
return;
}
Expand Down

0 comments on commit c614cb8

Please sign in to comment.