You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Export row/column prop builder functions
Previously the get<Row/Column>Class methods exported an array of classNames, which wasn't really suitable for passing
directly onto a className prop. Plus it didn't clean the props so the caller would know which were intended for them
and which were sizing props
This changes the exports to return an object with a `className` property and the rest of the props, so you can do
something like: `{className, ...otherProps} = getColumnProps(this.props)`
* Update composition example to show use with a third-party component
* Change component name, improve explanation
* Demonstrate re-use of existing propType validations
Copy file name to clipboardExpand all lines: README.md
+21-8Lines changed: 21 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,23 +59,36 @@ Looking for example to use `react-flexbox-grid`? Head over to [react-flexbox-gri
59
59
60
60
Advanced composition
61
61
-------
62
-
Functions for generating Row and Column classNames are exported for use in other components. For example, suppose you have a `MyFormInput` component that should also act as both a `Row` and a `Col`.
62
+
Functions for generating Row and Column classNames are exported for use in other components.
63
+
64
+
For example, suppose you're using a third party component that accepts a className and you would like it to be rendered as Column. You could do so by extracting the column sizing props that `MyComponent` uses and then pass the generated className on to `SomeComponent`
0 commit comments