Component Oluşturma

Örnek
Component Oluşturma
import { StyleSheet, Text, View } from 'react-native';

// You can import supported modules from npm
import { Card } from 'react-native-paper';

// or any files within the Snack
import Logo from './components/Logo1';

export default function App() {
  return (
    <View style={styles.container}>
      <Logo/><Logo/><Logo/><Logo/><Logo/>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    flexDirection:'row',
    justifyContent: 'flex-start',
    alignItems:"flex-start",
    backgroundColor: '#ecf0f1',
    padding: 8,
  },
});
Logo.js
import React from "react";
import {View, Image, Text, StyleSheet} from "react-native";

const Logo=()=> {
  return (
      <View style={Stiller.Kontainer}>
        <Image style={Stiller.Resim} source={require('../assets/gemi1.png')} />
        <Text style={{fontWeight:"bold"}}> BORUSAN</Text>
      </View>
  );
}

const Stiller = StyleSheet.create ({
  Kontainer: {
    //flex:1,
    flexDirection:"row",
    justifyContent:"center",
    alignItems:"center",
    border:1,
    borderStyle:"solid",
    borderColor:"black",
    backgroundColor:"yellow",
    margin:5,
    paddingHorizontal:15
  },
  Resim : {
    height:50,
    width:50
  }
});

export default Logo;
 
Yükleniyor...