Open rat-moonshine opened 6 years ago
I don't think there is a way, because the builder version creates a Text
internally and doesn't expose any reference outside. If you want it to be the same as builder version, try reading the source code to see what it is styled inside:
function coloredRaisedButton() {
return new ButtonBuilder()
.withStyle({
borderRadius: 2,
shadowRadius: 1,
shadowOffset: { width: 0, height: 0.5 },
shadowOpacity: 0.7,
shadowColor: 'black',
elevation: 4,
})
.withTextStyle({
color: 'white',
fontWeight: 'bold',
});
}
Hi,
I'm new to React Native, and working on an experimental app where I'm using
MKButton
. I have asked the same question at StackOverflow but didn't had any proper solution, so I thought to ask you here.Based on my limited knowledge, I've constructed the
MKButton
in following way:But I couldn't able to get it work due to different undefined reference errors at different times, or just no rendering of the button at all.
I see there's a way documented at here, but this also so much of writing and not renders same as button created with
MKButton.coloredButton().build()
, unfortunately:Can we do this in a
.build()
way and also change the label based on state change?Thanks!