-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Icons not working (showing ? instead) #2832
Comments
I finally get my icon but why do i have to add an option (type="FontAwesome") in the native base Icon component whereas it was not needed/required in NB 2.12.1 |
Similar issue, but ionicons not loading for me. |
Resolved with this comment: #2806 (comment) |
@stevesweets i'm not sure it's the same issue. |
Something after this merge #2804 broken the default behaviour |
Can you please share some more details about the broken behaviour, preferably screenshots and snacks to reproduce. |
Please refer to this. Hope this solves the issue. |
This is not a 'linking' problem. From my theme file 'platform.js'
Now, i have to add the prop 'type="FontAwesome"' to each component in order to make it work. Before this was not the case. If you don't provide the 'type' prop to your Icon's component they try to display icon's from a default font (ionicons i think) So icons appear with a '?' instead and not with a 'cross' like this X. If i try with a name that exist in ionicons font it's displaying good. |
It's a bug. Here is i'm write a comment on that. You can fix it by your self until the next version fixes this:
P.S. You can add this function to the file in the second step and run npm command compile to recompile library. |
version In IconNB.js
should be
For now, I have to back to |
Fixed in 2.13.8 |
Seems like |
`this.context` is always `undefined` in `constructor` method. Refer `context` argument instead. fix GeekyAnts#2832
I've tested the lastest version (2.13.8) and i've removed the 'type' prop in an 'Icon' component to test if it's always required and it shows me a '?' instead of the correct icon. So, i think that the problem still exist in this version :( |
I confirm, it is back in 2.13.8 |
+1 |
Mine is not even showing the '?', it just doesn't load: The icon on the left is a test to see if The Icons code: <Container style={styles.checkBoxContainer}>
<Icon type='FontAwesome' name='check' style={{color: palette.default.mainColor}} /> //Test Icon
<CheckBox
color={palette.default.mainColor}
style={styles.check}
checked={this.state.persistConnection}
onPress={()=>{
let s = this.state;
s.persistConnection = s.persistConnection?false:true;
this.setState(s);
}}
/>
<Text style={styles.checkLabel}>Manter-se conectado</Text>
</Container> My dependencies in {
"@react-native-community/async-storage": "^1.6.2",
"native-base": "^2.13.8",
"react": "16.8.3",
"react-native": "0.59.3",
"react-native-gesture-handler": "^1.4.1",
"react-native-linear-gradient": "^2.5.6",
"react-native-reanimated": "^1.3.0",
"react-native-screens": "1.0.0-alpha.23",
"react-native-splash-screen": "3.0.6",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^1.9.0"
} am I doing something wrong? |
This still not fixed thank you nismaxim82 i had been looking everywhere for a solution after upgrading this worked after adding
|
also confirming not fixed in 2.13.8 |
This one Worked for me for following configuration. "native-base": "^2.13.8", |
what about workin expo |
I fix this problem in my project importing the fontFamiliy that i want: https://expo.github.io/vector-icons/ Follow the code: const Index = () => {
const [ready, setReady] = useState(false);
if (!ready)
return (
<AppLoading
startAsync={async () =>
await Font.loadAsync({
Ionicons: require("native-base/Fonts/Ionicons.ttf")
})
}
onFinish={() => setReady(true)}
></AppLoading>
);
return (
<StyleProvider style={getTheme(platform)}>
<NavigationContainer>
<Routes></Routes>
</NavigationContainer>
</StyleProvider>
);
}; in the folder Fonts on the native-base you find more: My dependencies:
|
I ran yarn add @expo/vector-icons and rebuilt the project. Fixed it for me |
I had the same issue. I don't use expo.
ran I then had to remove the fonts from the "Copy Bundle Resources" phase in xcode in order to build for ios. |
I have same issue icon not working. |
If you're using the latest react-native-vector-icons, follow the steps mentioned in the docs for Android setup.
https://github.com/oblador/react-native-vector-icons?tab=readme-ov-file#android-setup |
Hello,
With those versions on windows 10 64bits:
"native-base": "2.12.2",
"react-native": "0.60.4",
"react-native-vector-icons": "6.6.0" -> (i know that this is not the dev-depedencie 6.1.0 but it works with NB 2.12.1)
Icons are displayed with '?' instead of the good one (fontAwesome for my case)
If i downgrade to "native-base": "2.12.1" it works well..
What about NativeBase working with RN 0.60.x and the fact that linking process is no longer needed with RN 0.60.x ?
I've replaced my custom theme with the native-base one (using node node_modules/native-base/ejectTheme.js) without changing a line but it does'nt solve my isssue.
The text was updated successfully, but these errors were encountered: