diff --git a/example/App.js b/example/App.js index 97dc39d..45bbf06 100644 --- a/example/App.js +++ b/example/App.js @@ -1,8 +1,11 @@ import React from 'react'; import Expo from 'expo'; import { FlatList, I18nManager } from 'react-native'; -import { createSwitchNavigator } from '@react-navigation/core'; -import { createStackNavigator } from 'react-navigation-stack'; +import { createSwitchNavigator } from 'react-navigation'; +import { + Assets as StackAssets, + createStackNavigator, +} from 'react-navigation-stack'; import { ListSection, Divider } from 'react-native-paper'; import SimpleStack from './src/SimpleStack'; @@ -41,12 +44,8 @@ const data = [ }, ]; -Expo.Asset.loadAsync( - require('react-navigation/src/views/assets/back-icon.png') -); -Expo.Asset.loadAsync( - require('react-navigation/src/views/assets/back-icon-mask.png') -); +// Cache images +Expo.Asset.loadAsync(StackAssets); class Home extends React.Component { static navigationOptions = { diff --git a/src/index.js b/src/index.js index 2e72c50..85a75e6 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,5 @@ /* eslint-disable import/no-commonjs */ +import { Platform } from 'react-native'; module.exports = { /** @@ -11,6 +12,15 @@ module.exports = { /** * Views */ + get Assets() { + return Platform.select({ + ios: [ + require('./views/assets/back-icon.png'), + require('./views/assets/back-icon-mask.png'), + ], + android: [require('./views/assets/back-icon.png')], + }); + }, get Header() { return require('./views/Header/Header').default; },