@@ -1,10 +1,8 @@
11import React from 'react';
22import cn from 'classnames';
33
4−import getComponent from '../lib/getComponent';
5−
64function Flex({
7− as = 'div',
5+ as: As = 'div',
86 row = false,
97 wrap = false,
108 col = false,
@@ -16,10 +14,8 @@ function Flex({
1614 if (row && col) {
1715 throw new Error('Only one of row or col must be true, not both.');
1816 }
19−
20− const Component = getComponent(as);
2117 return (
22− <Component
18+ <As
2319 className={cn(
2420 'flex',
2521 {
@@ -39,14 +35,13 @@ function Flex({
3935}
4036
4137// 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 }) {
4339 if (flex === true) {
4440 flex = 1;
4541 }
4642
47− const Component = getComponent(as);
4843 return (
49− <Component
44+ <As
5045 className={cn(
5146 {
5247 [`flex${flex}`]: flex,