From 62f55cae1ee09896eaf3e982adcb63bf5b392705 Mon Sep 17 00:00:00 2001 From: Antti Ahti Date: Wed, 2 Nov 2016 22:09:18 +0200 Subject: [PATCH 1/3] Support elements in icon attribute in IconButton This makes IconButton more flexible. It also makes icon elements work when used with leftIcon/rightIcon attributes in AppBar. --- components/button/IconButton.js | 2 +- components/button/readme.md | 1 + .../layout/main/modules/examples/button_example_1.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/button/IconButton.js b/components/button/IconButton.js index 3b4b3438..e2d8b495 100644 --- a/components/button/IconButton.js +++ b/components/button/IconButton.js @@ -65,7 +65,7 @@ const factory = (ripple, FontIcon) => { }; return React.createElement(element, props, - icon ? : null, + icon ? typeof icon === 'string' ? : icon : null, children ); } diff --git a/components/button/readme.md b/components/button/readme.md index ec079dab..41aa3547 100644 --- a/components/button/readme.md +++ b/components/button/readme.md @@ -23,6 +23,7 @@ const TestButtons = () => (