🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-native-default-style

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-default-style

Use ReactNative Components using default styles for each component.

0.0.3
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-default-style-version react-native-default-style-version

react-native-default-style

A React Native's module that allows you use all their components with predefined styles by default.

Installation

npm i -S react-native-default-style

Usage

Basic Usage

// src/configureDefaultStyles.js

import { setDefaultStyles, COMPONENT_TYPE } from 'react-native-default-style';

export const configureDefaultStyles = () => {
    const allDefaultStyles = {
        type: COMPONENT_TYPE.DEFAULT,
        styles: {
            backgroundColor: '#F00'
        }
    };

    const textDefaultStyles = {
        type: COMPONENT_TYPE.TEXT,
        styles: {
            color: '#FFF'
        }
    };

    setDefaultStyles([ allDefaultStyles, textDefaultStyles ]);
};
// src/app.js

import React, { Component } from 'react';
import { StyleSheet } from 'react-native';
import { configureDefaultStyles } from './configureDefaultStyles';
importView, Text } from 'react-native-default-style';

configureDefaultStyles(); // You must only execute once.

const MyView = (props) => {
  return (<View><Text>This is my first test</Text></View>);
}
const MyOtherView = (props) => {
  return (<View><Text style={myStyles.myOtherView}>This is my second test.</Text></View>);
}
const myStyles = StyleSheet.create({
  myOtherView: {
    color: '#09F',
  }
});

Keywords

react-native

FAQs

Package last updated on 14 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts