Button text color is black?
I've been using this library for a few weeks and everything looked like the docs. Now, for some reason the button color has switched to black. The disabled button is rendering opposite color schemes. (Grey on false, colored on true). I didn't change my version so I'm wondering what conflicted with this library to do this. Anyone had this happen?
import {
Text,
Button
} from 'native-base';
<Button
block
info
onPress={ this._handleContinuePress }>
<Text>Continue</Text>
</Button>

@nolan-m I have same problem !. have you solved this??
@iiitmahesh Nope, I'm about ready to remove NativeBase and create my own components since I can't figure out why this changed.
same issue , waiting feedback
Just noticed the Segment is messed up as well.

@nolan-m Which version are you on?
@himanshu-satija 2.1.0
I removed all dependencies to see if something was conflicting, but no luck.
"dependencies": {
"babel": "^6.23.0",
"moment": "^2.18.1",
"native-base": "^2.1.0",
"react": "15.4.2",
"react-native": "^0.42.3",
"react-navigation": "^1.0.0-beta.6",
"react-redux": "^5.0.3",
"redux": "^3.6.0",
"redux-thunk": "^2.2.0"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-plugin-module-resolver": "^2.5.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"react-native-cli": "^2.0.1",
"react-test-renderer": "15.4.2"
},
Did some more digging around. Looked at a demo project that I knew had the correct colors. Downgraded my version to specifically 2.0.11 (without ^). Hoping someone with more knowledge of this project can figure out what is conflicting between newer version.
"native-base": "2.0.11",
Try uninstalling and reinstalling native-base (npm uninstall native-base && npm install native-base) and see if that fixes your issue.
If you have ejected native-base theme, try ejecting it again from the latest version.
I did that first and nothing changed. Have not ejected.
@nolan-m I tested this and I can confirm that this is a bug introduced in v2.1.0. Button text looks fine inside Content but gets incorrect style when used without Content.
It will be fixed in the next version.
@nolan-m There was an issue in one of our dependencies which directly gets installed from GitHub. I have fixed it. Uninstalling and reinstalling native-base should fix your issue.
I know we should ideally release a patch but we'll go with a quick fix for now. Anyone facing this issue ( @nimerfarahty @iiitmahesh ) should run npm uninstall native-base && npm i native-base
himanshu-satija's solution worked for me.
npm uninstall native-base && npm i native-base
Didn't work for me unfortunately. Anything else to try?
@mcapodici Try npm uninstall native-base @shoutem/theme && npm i native-base and let me know if it works.
You can also try removing node_modules and running npm install
@himanshu-satija thanks for the tip.
That didn't work unfortunately either.
For further information I get this every time I do npm install:
npm WARN @shoutem/[email protected] requires a peer of react@^15.0.0 but none was installed.
npm WARN @shoutem/[email protected] requires a peer of react@^15.1.0 but none was installed.
npm WARN [email protected] requires a peer of react@^0.13.0 || ^0.14.0 || ^15.0.0 but none was installed.
And this is my package.json:
{
"name": "WhoCanICall",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"immutability-helper": "^2.1.2",
"moment": "^2.18.1",
"moment-timezone": "^0.5.13",
"native-base": "^2.1.1",
"react": "16.0.0-alpha.6",
"react-mixin": "^3.0.5",
"react-native": "0.43.2",
"react-native-communications": "^2.2.1",
"react-timer-mixin": "^0.13.3"
},
"devDependencies": {
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"jest": "19.0.2",
"react-test-renderer": "16.0.0-alpha.6"
},
"jest": {
"preset": "react-native"
}
}
@mcapodici Try with NativeBase v2.1.2. If you had ejected native-base-theme earlier, try ejecting again.
If you're still facing issues, please post a code snippet.
Closing this as the above solution should work.
Not sure if it will help anyone else but realised I had this Issue because I was importing the Text component from 'react-native' rather than 'native-base'
I had the same issue on NativeBase v2.3.3 and the work around is to add primary to text:
<Button primary>
<Text primary>Click Me</Text>
</Button>