Skip to content

Commit 31268ef

Browse files
author
rofrischmann
committed
2.2.0 release
1 parent c07dfb6 commit 31268ef

File tree

4 files changed

+15
-13
lines changed

4 files changed

+15
-13
lines changed

Changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Changelog
22

33
## 2.0
4+
### 2.2.0
5+
* Replaced [inline-style-prefixer](https://github.com/rofrischmann/inline-style-prefixer) with lightweight [inline-style-prefix-all](https://github.com/rofrischmann/inline-style-prefix-all)
6+
* adds server-side rendering support for every Component
7+
* `width` and `height` from `<ScrollView>` now longer are required
8+
49
### 2.1.2
510
* fixed shorthand Components
611

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ npm install react-layout-components
55
Useful, Modern and universal layout Components for [React.js](https://facebook.github.io/react/) based on flexbox.<br>
66

77
The basis `<Box>` Component is highly inspired by [React Native](https://facebook.github.io/react-native/)'s [Flexbox](https://facebook.github.io/react-native/docs/flexbox.html#content) implementation and though accepts almost the same props.
8-
It supports all flexbox specifications and automatically adds alternative values and prefixes thanks to [inline-style-prefixer](https://github.com/rofrischmann/inline-style-prefixer) if needed.
8+
It supports all flexbox specifications and automatically adds alternative values and prefixes thanks to [inline-style-prefix-all](https://github.com/rofrischmann/inline-style-prefix-all) if needed.
99

1010
> **Note**: If you're not familiar with Flexbox at all, I recommend [css-tricks 'Complete Guide to Flexbox'](https://css-tricks.com/snippets/css/a-guide-to-flexbox/) which is an awesome source for beginners as well as a nice refreshment for experts.
1111
@@ -84,7 +84,7 @@ Browser default values don't need to be set explicit and are defined as
8484
```
8585

8686
## Container
87-
Container is a Component to style [Box-model](https://css-tricks.com/the-css-box-model/)
87+
Container is a Component to style [box-model](https://css-tricks.com/the-css-box-model/)
8888
properties.
8989

9090
### Props
@@ -116,14 +116,13 @@ There are some shortcut properties. They do not accept a value. e.g.
116116
Page is just a shortcut for a page-filling Component. It also is fixed to the edges of your WebView.
117117

118118
## ScrollView
119-
ScrollView is a scrollable container. You **must** set both `height` and `width` to achieve a scrollable container.
120-
119+
ScrollView is a scrollable container. It is build on the `<Box>`-Component, which let's you either use default box-model sizing or flexbox sizing.
121120
### Props
122121

123122
| Property | Description | Options
124123
| ---------------- | --------------------------------------- | -------------------- |
125-
| height | container height | required
126-
| width | container width | required
124+
| height | container height |
125+
| width | container width |
127126
| horizontal | enables horizontal scrollable container | `boolean`
128127
| initialScrollPos | scroll position | `number`
129128
| onScroll | gets fired on scrolling | `function`

modules/components/Box.jsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import React, { Component } from 'react'
2-
import Prefixer from 'inline-style-prefixer'
2+
import prefixAll from 'inline-style-prefix-all'
33
import warn from '../utils/warn'
44

5-
const prefixer = new Prefixer()
6-
75
/**
86
* Flexbox Component
97
*/
@@ -69,8 +67,8 @@ export default class Box extends Component {
6967
})
7068

7169
// processing styles and normalizing flexbox specifications
72-
prefixer.prefix(styles)
70+
const prefixedStyles = prefixAll(styles)
7371

74-
return <div {...props} style={{...styles, ...props.style}}>{props.children}</div>
72+
return <div {...props} style={{...prefixedStyles, ...props.style}}>{props.children}</div>
7573
}
7674
}

modules/components/ScrollView.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export default class ScrollView extends Component {
1111
initialScrollPos: 0
1212
}
1313
static propTypes = {
14-
width: PropTypes.any.isRequired,
15-
height: PropTypes.any.isRequired,
14+
width: PropTypes.any,
15+
height: PropTypes.any,
1616
horizontal: PropTypes.bool,
1717
initialScrollPos: PropTypes.number
1818
}

0 commit comments

Comments
 (0)