From 2c4ad5d3513a21ebac20f14f08cf0563e4237d9e Mon Sep 17 00:00:00 2001 From: "Samuel P. Bowman" Date: Tue, 9 Nov 2021 10:57:28 -0500 Subject: [PATCH 1/2] remove ViewPropTypes --- Dash.js | 8 ++++++-- README.md | 4 ++-- dist/index.js | 8 ++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Dash.js b/Dash.js index 32ff1ec..9ff8c06 100644 --- a/Dash.js +++ b/Dash.js @@ -43,12 +43,16 @@ const styles = StyleSheet.create({ }) Dash.propTypes = { - style: ViewPropTypes.style, + style: PropTypes.shape({ + style: PropTypes.any, + }), dashGap: PropTypes.number.isRequired, dashLength: PropTypes.number.isRequired, dashThickness: PropTypes.number.isRequired, dashColor: PropTypes.string, - dashStyle: ViewPropTypes.style, + dashStyle: PropTypes.shape({ + style: PropTypes.any, + }), } Dash.defaultProps = { diff --git a/README.md b/README.md index 89cac84..7812bb9 100644 --- a/README.md +++ b/README.md @@ -11,12 +11,12 @@ npm i --save react-native-dash ## Props | name | desc | type | default | --- | --- | --- | --- | -| `style` | Dash container style | [View.PropTypes.Style](https://facebook.github.io/react-native/docs/view.html#style) | `{flexDirection = 'row'}` +| `style` | Dash container style | ViewProps.shape({style: ViewProps.any}) | `{flexDirection = 'row'}` | `dashGap` | Gap between two dashes | number | `2` | `dashLength` | Length of each dash | number | `4` | `dashThickness` | Thickness of each dash | number | `2` | `dashColor` | Color of each dash | string | `black` -| `dashStyle` | Dashes style | [View.PropTypes.Style](https://facebook.github.io/react-native/docs/view.html#style) | {} +| `dashStyle` | Dashes style | ViewProps.shape({style: ViewProps.any}) | {} - **ProTip 1**: Use `flexDirection` in style to get horizontal or vertical dashes. By default, it's `row` - **ProTip 2**: Use `{borderRadius: 100, overflow: 'hidden'}` in dashStyle to get rounded dotes instead of straight line dashes. diff --git a/dist/index.js b/dist/index.js index 4034e31..6107626 100644 --- a/dist/index.js +++ b/dist/index.js @@ -54,12 +54,16 @@ var styles = _reactNative.StyleSheet.create({ }); Dash.propTypes = { - style: _reactNative.ViewPropTypes.style, + style: _propTypes2.default.shape({ + style: _propTypes2.default.any + }), dashGap: _propTypes2.default.number.isRequired, dashLength: _propTypes2.default.number.isRequired, dashThickness: _propTypes2.default.number.isRequired, dashColor: _propTypes2.default.string, - dashStyle: _reactNative.ViewPropTypes.style + dashStyle: _propTypes2.default.shape({ + style: _propTypes2.default.any + }) }; Dash.defaultProps = { From 880dd384026f7fded495ea90bc205a809e7cb2d1 Mon Sep 17 00:00:00 2001 From: "Samuel P. Bowman" Date: Tue, 9 Nov 2021 11:42:37 -0500 Subject: [PATCH 2/2] remove unused import --- Dash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dash.js b/Dash.js index 9ff8c06..895e733 100644 --- a/Dash.js +++ b/Dash.js @@ -6,7 +6,7 @@ import React from 'react' import PropTypes from 'prop-types' -import { View, StyleSheet, ViewPropTypes } from 'react-native' +import { View, StyleSheet } from 'react-native' import MeasureMeHOC from 'react-native-measureme' import { getDashStyle, isStyleRow } from '../util'