From 086e03134c9a8bf251c7a4360bbacbc8a516afad Mon Sep 17 00:00:00 2001 From: mryarbles Date: Wed, 3 Jul 2019 13:21:56 -0700 Subject: [PATCH] Adding className as a prop The blank, unstylable div being created by this library can be frustrating. --- src/Sticky.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Sticky.js b/src/Sticky.js index fff3a208..eb370206 100644 --- a/src/Sticky.js +++ b/src/Sticky.js @@ -7,7 +7,8 @@ export default class Sticky extends Component { topOffset: PropTypes.number, bottomOffset: PropTypes.number, relative: PropTypes.bool, - children: PropTypes.func.isRequired + children: PropTypes.func.isRequired, + className: PropTypes.string }; static defaultProps = { @@ -15,7 +16,8 @@ export default class Sticky extends Component { topOffset: 0, bottomOffset: 0, disableCompensation: false, - disableHardwareAcceleration: false + disableHardwareAcceleration: false, + className: '' }; static contextTypes = { @@ -128,7 +130,7 @@ export default class Sticky extends Component { ); return ( -
+
(this.placeholder = placeholder)} /> {element}