Skip to content

remove ViewPropTypes #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Dash.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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 = {
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 6 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down