Comments (4)
@cyprusglobe I did install @exponent/vector-icons, although I had not done the --save-dev (i.e. it was not in package.json). However AFAIK that should not make a difference.
the error stems from the following line in Icon.js (part of native-base):
import Ionicons from 'react-native-vector-icons/Ionicons';
I repeated the same steps in a clean project and it still doesn't work, although I get a slightly different error:
from expo.
https://github.com/exponent/nativebase-example
from expo.
@acornejo did you by chance run
npm install @exponent/vector-icons --save-dev
or yarn add @exponent/vector-icons
inside your project?
from expo.
Finally made these work. Several things were missing.
First, exp.json had to be modified to include "ttf" in assetExts.
That got me past the first few errors.
Next, the native-base package (the version listed in the original exponent blog post advertising working UI toolkits), depends on the roboto font for its default theme.
For that to work I needed the following wrapper on the app:
class Wrapper extends React.Component {
state = { fontsAreLoaded: false };
async componentWillMount() {
await Exponent.Font.loadAsync({
'Roboto_medium': require('native-base/Fonts/Roboto_medium.ttf')
});
this.setState({fontsAreLoaded: true});
}
render() {
if (this.state.fontsAreLoaded)
return <App/>;
else
return <Exponent.Components.AppLoading/>;
}
}
The blog post was misleading since it implied that native-base would work without any special tweaks beyond doing npm install native-base, this was not the case. Summarizing required steps were:
- Edit exp.json to tweak asset extensions
- Install exponent/vector-icons
- Load roboto font using exponent's load-async.
from expo.
Related Issues (20)
- EAS build failed: Unresolved reference: UPSIDE_DOWN_CAKE HOT 2
- Bug in start app with Expo Go HOT 4
- [expo-updates]AppController.sharedInstance Thread 1: Swift runtime failure: Unexpectedly found nil while unwrapping an Optional value HOT 12
- Expo Router: Swipe gesture to navigate back to previous route in stack is not working HOT 3
- Failed to start recording Error: Call to function 'ExponentAV.setAudioMode' has been rejected. → Caused by: The 1st argument cannot be cast to type expo.modules.core.arguments.ReadableArguments (received Map) → Caused by: Cannot find type converter for 'expo.modules.core.arguments.ReadableArguments'. HOT 2
- [expo-updates]AppController.sharedInstance Thread 1: Swift runtime failure: Unexpectedly found nil while unwrapping an Optional value #28049 HOT 5
- [docs] Expo should drop Yarn 1 recommendation HOT 1
- How can I set different version numbers for android and ios? HOT 1
- Getting Error when build native Android project HOT 3
- Nested Navigating HOT 1
- [expo-image] Some images cause a crash on iOS when using `enableLiveTextInteraction` without `NSContactsUsageDescription` set
- [expo-camera/next 14.1.*] Expo Go app crashes when opening Camera HOT 7
- Error: Module "7" is missing from the asset registry [Expo 50, Expo-Router] HOT 3
- Default exporting unnamed function in layout causes navigation state loss on hot-reloading HOT 1
- [expo-router] Swipe-back gesture doesn't work on web HOT 1
- [expo-camera/next] Video does not record. HOT 2
- Set image as home screen/lock screen wallpaper HOT 1
- `eas update` in SDK 49 doesn't use Config.js, nor EAS eas.json env resulting app.config.ts not having proper ENV. HOT 2
- Login problem HOT 1
- Expo store review not working on android emulator HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from expo.