react-native-material-ui icon indicating copy to clipboard operation
react-native-material-ui copied to clipboard

Adding the ability to pass a custom children to button

Open JoaoBGusmao opened this issue 5 years ago • 3 comments

Done this change to allow us to pass a custom children component. This can be util when you need to pass something different than only a text component.

JoaoBGusmao avatar Mar 14 '19 20:03 JoaoBGusmao

What else you want to pass there?

xotahal avatar Mar 14 '19 21:03 xotahal

I was thinking about two situation: 1 - Some of my buttons have icons on the right side. The way material-ui do today, we can't pass a icon to the right side. I was able to invert the icon direction using flexDirection: 'row-reverse' on container style, but I still can't change the 8px right margin, and this make the content to be not centralized. 2 - I have a button that looks like a link (with underline). I was planning to pass a custom Text, but I saw I can pass a custom style to it.

So, after all I don't think I have more cases that I can't solve with the current resources, so, feel free to close it if you don't think it's necessary

JoaoBGusmao avatar Mar 14 '19 21:03 JoaoBGusmao

@JoaoBGusmao You can override style on the icon by passing style={icon: {marginRight: 0}}. IDK why it's not defined on the proptypes, I might open a PR for that.

I personally would like to have custom children component tho! Can think of couple usecases, i.e. displaying an ActivityIndicator.

atsuzaki avatar Apr 22 '19 12:04 atsuzaki