@@ -1,10 +1,8 @@
1import React from 'react';
1import React from 'react';
2import cn from 'classnames';
2import cn from 'classnames';
4−import getComponent from '../lib/getComponent';
6function Flex({
4function Flex({
7− as = 'div',
5+ as: As = 'div',
8 row = false,
6 row = false,
9 wrap = false,
7 wrap = false,
10 col = false,
8 col = false,
@@ -16,10 +14,8 @@ function Flex({
16 if (row && col) {
14 if (row && col) {
17 throw new Error('Only one of row or col must be true, not both.');
15 throw new Error('Only one of row or col must be true, not both.');
20− const Component = getComponent(as);
23 className={cn(
19 className={cn(
@@ -39,14 +35,13 @@ function Flex({
41// flex can be boolean {true} or integer flex
37// flex can be boolean {true} or integer flex
42−Flex.Item = function FlexItem({ as = 'div', flex, className, ...rest }) {
38+Flex.Item = function FlexItem({ as: As = 'div', flex, className, ...rest }) {
43 if (flex === true) {
39 if (flex === true) {
47− const Component = getComponent(as);
50 className={cn(
45 className={cn(
52 [`flex${flex}`]: flex,
47 [`flex${flex}`]: flex,