JavaScript How to add an image to Header of Navigation Drawer in React Native? image navigation header,header image react navigation

I am trying to add a company logo to header of Drawer Navigator, but it displays only screen's title. Here is my code:

import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View, ScrollView, Dimensions, Image} from 'react-native';
import { createDrawerNavigator, createAppContainer, DrawerItems, SafeAreaView } from 'react-navigation';
import HomeScreen from './screens/HomeScreen';
import SettingsScreen from './screens/SettingsScreen';

class App extends Component {
  render() {
    return (
      <AppNavigator />
    );
  }
}

const AppNavigator = createDrawerNavigator({
  Home: {screen: HomeScreen},
  Settings: {screen: SettingsScreen},
},
{
  CustomDrawerContentComponent: props => (
    <SafeAreaView style={styles.container}>
        <View style={{height: 150, backgroundColor: '#fff', alignItems: 'center', justifyContent: 'center'}}>
          <Image source={require('./assets/typeme.png')} style={{height: 120, width:200}}></Image>
        </View>
      <ScrollView>
        <DrawerItems {...props} />
      </ScrollView>
    </SafeAreaView>
  )
}
);

const DrawerContent = (props) => (
  <View>
    <View
      style={{
        backgroundColor: '#f50057',
        height: 140,
        alignItems: 'center',
        justifyContent: 'center',
      }}
    >
      <Text style={{ color: 'white', fontSize: 30 }}>
        Header
      </Text>
    </View>
    <DrawerItems {...props} />
  </View>
)

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});

export default createAppContainer(AppNavigator);

"dependencies": {
        "native-base": "^2.10.0",
        "react": "16.6.3",
        "react-native": "0.55.2",
        "react-native-gesture-handler": "^1.0.12",
        "react-navigation": "^3.0.9"
      }
Answer:1

I have an array containing several objects similar to the following: {person: {name: "Steve", id: 1}, role: 1} {person: {name: "Phil", id: 2}, role: 1} {person: {name: "Steve", id: 1}, role: 3} {...

I have an array containing several objects similar to the following: {person: {name: "Steve", id: 1}, role: 1} {person: {name: "Phil", id: 2}, role: 1} {person: {name: "Steve", id: 1}, role: 3} {...

  1. return objects array
  2. return array objects php
  3. return array objects angular
  4. return objects in array javascript
  5. java return objects array
  6. c# return array objects
  7. return all objects in array
  8. return all objects in array javascript
  9. return objects inside array

I want to pass the value from select list - ListComponentComponent to sibling component - DisplayComponentComponent and display the value in the template of DisplayComponentComponent. I want to use ...

I want to pass the value from select list - ListComponentComponent to sibling component - DisplayComponentComponent and display the value in the template of DisplayComponentComponent. I want to use ...

import React, { useContext } from 'react'; useContext is undefined. error details: Uncaught (in promise) TypeError: Object(...) is not a function error when processing const context = ...

import React, { useContext } from 'react'; useContext is undefined. error details: Uncaught (in promise) TypeError: Object(...) is not a function error when processing const context = ...

  1. react typeerror object(...) is not a function
  2. react typeerror object.values is not a function
  3. react typeerror object(...)(...).then is not a function
  4. react typeerror object expected
  5. react typeerror object(...) is not a function hooks
  6. react typeerror object(...)(...) is undefined
  7. reactjs typeerror object(...) is not a function
  8. react uncaught typeerror object(...) is not a function
  9. react usestate typeerror object(...) is not a function
  10. react redux typeerror object(...) is not a function
  11. react bootstrap typeerror object(...) is not a function
  12. react lazy typeerror object(...) is not a function
  13. react useeffect typeerror object(...) is not a function
  14. react dropzone typeerror object(...) is not a function
  15. react makestyles typeerror object(...) is not a function
  16. react × typeerror object(...) is not a function
  17. react hoc typeerror object(...) is not a function
  18. react typeerror cyclic object value
  19. react error typeerror object(...) is not a function
  20. react useref typeerror object(...) is not a function

var imagecount = 1; var total = 3; I'd like to know why I can't make an imageslider this way. I have pictures saved such as studentbild1, studentbild2 and studentbild3. How do I get those to show in ...

var imagecount = 1; var total = 3; I'd like to know why I can't make an imageslider this way. I have pictures saved such as studentbild1, studentbild2 and studentbild3. How do I get those to show in ...