From 23c913dc3c042a6cfd826266e6fe482b54ba9cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20Anic=CC=81-Antic=CC=81?= Date: Thu, 27 Jun 2019 11:04:06 +0200 Subject: [PATCH 1/3] Passing props to scroll view --- src/components/grid/Scrollable.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/grid/Scrollable.js b/src/components/grid/Scrollable.js index 06af948..4492ee2 100644 --- a/src/components/grid/Scrollable.js +++ b/src/components/grid/Scrollable.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { StyleSheet, ScrollView } from 'react-native'; +import { StyleSheet, ScrollView, ScrollViewProps } from 'react-native'; const styles = StyleSheet.create({ stretch: { @@ -13,11 +13,12 @@ const styles = StyleSheet.create({ /** * Component for wrapping scrollable content. * - * @type {React.StatelessComponent<{stretch: boolean, horizontal: boolean, children: any}>} + * @type {React.StatelessComponent<{stretch: boolean, horizontal: boolean, children: any, props: ScrollViewProps}>} */ /* eslint-enable */ -const Scrollable = ({ children, stretch, horizontal }) => ( +const Scrollable = ({ children, stretch, horizontal, ...props }) => ( @@ -33,6 +34,7 @@ Scrollable.propTypes = { ]).isRequired, stretch: PropTypes.bool, horizontal: PropTypes.bool, + props: ScrollViewProps }; Scrollable.defaultProps = { From ea39921c5fe1d2ddade55217e11ab9c4dfb4d7f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20Anic=CC=81-Antic=CC=81?= Date: Thu, 27 Jun 2019 11:07:46 +0200 Subject: [PATCH 2/3] Exposing props from Grid to Scrollable --- src/components/grid/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/grid/index.js b/src/components/grid/index.js index 6c0d406..2cf58c8 100644 --- a/src/components/grid/index.js +++ b/src/components/grid/index.js @@ -198,6 +198,7 @@ class Grid extends Component { return ( From 850fb1437346a6f60251413f590cc05994a0b358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20Anic=CC=81-Antic=CC=81?= Date: Thu, 27 Jun 2019 11:38:47 +0200 Subject: [PATCH 3/3] Adding default prop --- src/components/grid/Scrollable.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/grid/Scrollable.js b/src/components/grid/Scrollable.js index 4492ee2..00998e1 100644 --- a/src/components/grid/Scrollable.js +++ b/src/components/grid/Scrollable.js @@ -34,12 +34,13 @@ Scrollable.propTypes = { ]).isRequired, stretch: PropTypes.bool, horizontal: PropTypes.bool, - props: ScrollViewProps + props: ScrollViewProps, }; Scrollable.defaultProps = { stretch: false, horizontal: false, + props: {}, }; export default Scrollable;