Skip to content

Commit

Permalink
Fix leftElement to work with any element and not just icon names (#46)
Browse files Browse the repository at this point in the history
* Fix leftElement to work with any element and not just icon names

* Fix leftElement to work with any element and not just icon names

* added style container
  • Loading branch information
pfulop authored and xotahal committed Nov 18, 2016
1 parent 83a8e31 commit 6cef3d6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Toolbar/Toolbar.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,14 @@ class Toolbar extends PureComponent {
return null;
}

if (!this.state.isSearchActive && React.isValidElement(leftElement)) {
return (
<View style={style.leftElementContainer}>
{React.cloneElement(leftElement, { key: 'customLeftElement' })}
</View>
);
}

let iconName = leftElement;
let onPress = onLeftElementPress;

Expand Down

0 comments on commit 6cef3d6

Please sign in to comment.