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)
- Expo Image Picker Not working on Android 14 HOT 2
- expo-camera/next onResponsiveOrientationChanged event type mismatch HOT 6
- Error: The method or property expo-crypto.getRandomBytes is not available on android, are you sure you've linked all the native dependencies properly? HOT 1
- (Expo Router 3.5.2) - Wrapping route in Slot/Stack layout causes params to be undefined HOT 1
- can't copy object JS Debugger (DevTools) on SDK 50 HOT 5
- [Android][SDK 50] expo-camera/next causes freeze on render for specific OnePlus Device model HOT 1
- New expo and react native project events do not work HOT 2
- its telling me that i cant run the expo app on web because i have not yet installed the web dependencies HOT 1
- Cannot read property 'useMemo' of null HOT 20
- [SDK51/router 3.5.3] Href prop on Link not typed HOT 2
- expo-build-properties doesn't set iOS deployment target correctly. HOT 1
- expo-build-properties doesn't set iOS deployment target correctly. HOT 2
- Expo font not working HOT 1
- build error (in target 'EXUpdates' from project 'Pods') HOT 1
- [docs] @example tags are not rendered correctly HOT 1
- expo-image-picker doesn't return the cancel event on Web HOT 1
- Cannot build for iOS 17.4 with JSC - Expo 51 Beta HOT 4
- [SDK 51 beta] Build failing when not using Expo CLI integration in bare app HOT 10
- Cannot build when including react-native-skia with SDK 51 beta HOT 4
- Issue when running yarn test - Expo SDK 51 HOT 1
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.