diff --git a/package.json b/package.json index 3f6825c..c2b0cf8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-flex-grid", - "version": "0.11.0", + "version": "0.12.0", "description": "🎨 A react-native flexbox grid similar to bootstap's web grid.", "main": "node_modules/expo/AppEntry.js", "module": "lib/module/index.js", diff --git a/scripts/prep-package.js b/scripts/prep-package.js index 4e97a49..1e244bd 100644 --- a/scripts/prep-package.js +++ b/scripts/prep-package.js @@ -15,10 +15,7 @@ const packageJsonFile = editJsonFile('package.json'); // Update `main` field to support npm package instead of expo dev packageJsonFile.set( 'main', - args[0] === 'expo' - ? 'node_modules/expo/AppEntry.js' - : packageJsonFile.data.module?.replace('module', 'commonsjs') || - 'lib/commonjs/index.js', + args[0] === 'expo' ? 'node_modules/expo/AppEntry.js' : 'src/index.ts', ); // Save file diff --git a/src/components/Layout/Col/Col.tsx b/src/components/Layout/Col/Col.tsx index db665ea..04264e7 100644 --- a/src/components/Layout/Col/Col.tsx +++ b/src/components/Layout/Col/Col.tsx @@ -41,12 +41,12 @@ export declare interface ColProps extends ViewProps { lgOrder?: number | string; /** xl order */ xlOrder?: number | string; - /** Element to render */ - Element?: React.ElementType; /** Gutter size -- [Bootstrap Gutters](https://getbootstrap.com/docs/5.0/layout/gutters/) */ gx?: 0 | 1 | 2 | 3 | 4 | 5; /** Direction */ dir?: 'ltr' | 'rtl'; + /** Element to render - defaults to View */ + Element?: React.ElementType; } /** converts decimal to percent string */ diff --git a/src/components/Layout/Container/Container.tsx b/src/components/Layout/Container/Container.tsx index ace2537..ae83ae5 100644 --- a/src/components/Layout/Container/Container.tsx +++ b/src/components/Layout/Container/Container.tsx @@ -9,7 +9,7 @@ export declare interface ContainerProps extends ViewProps { fluid?: boolean; /** No Padding */ noPadding?: boolean; - /** Element to render */ + /** Element to render - defaults to View */ Element?: React.ElementType; } diff --git a/src/components/Layout/Row/Row.tsx b/src/components/Layout/Row/Row.tsx index d0d16d5..489c94e 100644 --- a/src/components/Layout/Row/Row.tsx +++ b/src/components/Layout/Row/Row.tsx @@ -8,6 +8,8 @@ export declare interface RowProps extends ViewProps { gx?: 0 | 1 | 2 | 3 | 4 | 5; /** Direction */ dir?: 'ltr' | 'rtl'; + /** Element to render - defaults to View */ + Element?: React.ElementType; } const styles = StyleSheet.create({ @@ -21,16 +23,20 @@ const styles = StyleSheet.create({ }); /** Row */ -const Row = ({ style, gx = 4, dir = 'ltr', ...rest }: RowProps) => ( - ( +