JSPM

react-native-style-prop-type

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q51024F
  • License ISC

A React PropType for React Native styles

Package Exports

  • react-native-style-prop-type
  • react-native-style-prop-type/src/react-native-style-prop-type.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-style-prop-type) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

React Native Style Prop Type

code style: prettier

js-standard-style

Usage

Validate React Native styles by ensuring the style keys are valid React Native style properties.

You can use ReactNativeStylePropType.isRequired similar to the built-in proptypes.

import { Text, View } from 'react-native';
import ReactNativeStylePropType from 'react-native-style-prop-type';

const Component = ({ style, textStyle }) => (
  <View style={style}>
    <Text style={textStyle}>My Component</Text>
  </View>
);

Component.propTypes = {
  style: ReactNativeStylePropType.isRequired,
  textStyle: ReactNativeStylePropType
};

Installation

npm i react-native-style-prop-type -S