- add app.json, set the newest sdkVersion
{
"name": "<yourname>",
"displayName": "<yourname>",
"expo": {
"sdkVersion": "25.0.0"
}
}
- add to package.json, something:
"react-native": "https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz" // according to package.json's sdkVersion
- add to index.ts:
import { KeepAwake, registerRootComponent } from 'expo';
import { App } from './app';
if (__DEV__) {
KeepAwake.activate();
}
registerRootComponent(App);
- add to app.tsx
import { Font } from 'expo';
interface AppProps {
dispatch: Dispatch<any>;
nav: NavigationState;
}
export class App extends Component<AppProps> {
constructor(props: any) {
super(props)
this.state = {
isFontLoaded: false
};
}
public componentDidMount() {
Font.loadAsync({
'<customFontName>': require('../assets/fonts/<customFontName>.ttf')
}).then(() => this.setState({ isFontLoaded: true }));
}
public render() {
return (this.state as any).isFontLoaded ? <App /> : null;
}
}
npm i expo
npm i exponent
exp start
- Enjoy
Hey, how can i convert it in js.