react-native-material-kit
react-native-material-kit copied to clipboard
After a button is re-enabled after being disabled, the color stays disabled
I have a button that is disabled when a form is submitted and re-enabled after submission fails.
When the button is disabled it is grayed out. But the grayed out state is not removed when disabled is set to false.
const FullWidthBtn = MKButton.coloredButton()
.withBackgroundColor(styleVars.secondaryColor)
.build();
const FullWidthButton = ({ children, ...rest }) => (
<FullWidthBtn {...rest}>
<Text style={[stylesheet.btn, stylesheet.btnText]}>{children}</Text>
</FullWidthBtn>
);
[...]
<FullWidthButton onPress={handleSubmit} disabled={submitting}>
<Text>{intl.formatMessage({ id: 'ui.login' }).toUpperCase()}</Text>
</FullWidthButton>