2.0.5 • Published 2 years ago

rn-units v2.0.5

Weekly downloads
1
License
ISC
Repository
github
Last release
2 years ago

npm npm

Set of helpers and components for the react-native projects.

"I hope they help someone to write less code and to solve common problems.."

Installation:

npm i rn-units --safe

or

yarn add rn-units

Constants

Don't support dynamic updates!

PropsType
screenWidthNumber
screenHeightNumber
isLandscapeBoolean
isPortraitBoolean
isIOSBoolean
isAndroidBoolean

Methods

PropsDescription
vwpercent of screen width width: vw(90)
vhpercent of screen height height: vh(10)
remresponsive units for markup width: rem(20)
fontresponsive units for font size fontSize: font(20)
imgconverts url or filepath into img source <Image source={img('http://...')} />
waitcreates delay in async functions await wait(1000) // delay 1000ms
secondsconverts seconds to milliseconds setTimeout(foo, seconds(10)
minutesconverts minutes to milliseconds setTimeout(foo, minutes(10)
hoursconverts hours to milliseconds setTimeout(foo, hours(10)
daysconverts days to milliseconds setTimeout(foo, days(10)
weeksconverts weeks to milliseconds setTimeout(foo, weeks(10)
combineStylesused to combine multiple styles <Image style={combineStyles(styles.logo, styles.centered)} >
equalsused compare items const areEqual = equals({id: 0}, {id: 0})
cloneused deepClone item const clonedObject = clone({ deep: { id: 0 } })
2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.0

3 years ago

0.0.14

3 years ago

0.0.12

4 years ago

0.0.13

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago