New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Maintainers
1
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc