Styling in React native

Write Styling for the particular component in that components same .js file.

Header.js file

// Import libraries for making a component
import React from 'react';
import { Text } from 'react-native';

// Make a component
const Header = () => {

const {textStyle, viewStyle} = styles; //add all styles here
  return (
    ‹View style = {viewStyle} 
      ‹Text style = {textStyle} Header Text ‹/Text› 

const styles = {
viewStyle : {
    backgroundColor : '#f0f0f0'
textStyle : {
  fontSize : 20

// Make the component available to other parts of the app
export default Header;


Hope you find this blog useful. Please feel free to contact with me in case you have any query, suggestions.  You can comment, like and follow posts.

You can request any topic related to Swift, React native and iOS development.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s