Skip to content

Commit e49caae

Browse files
committed
moved props & added doc
1 parent 511b9d4 commit e49caae

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export default class Headroom extends Component {
334334
}
335335

336336
render () {
337-
const { className: userClassName, ...divProps } = this.props
337+
const { className: userClassName, tag: Tag, ...divProps } = this.props
338338
delete divProps.onUnpin
339339
delete divProps.onPin
340340
delete divProps.onUnfix
@@ -395,8 +395,6 @@ export default class Headroom extends Component {
395395
? `${userClassName} headroom-wrapper`
396396
: 'headroom-wrapper'
397397

398-
const { tag: Tag } = this.props
399-
400398
return (
401399
<Tag style={wrapperStyles} className={wrapperClassName}>
402400
<div

www/pages/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,4 @@ Another option is to use CSS. The component has a `headroom` class as well as a
7676
* `wrapperStyle` — pass styles for the wrapper div (this maintains the components vertical space at the top of the page).
7777
* `parent` — provide a custom 'parent' element for scroll events. `parent` should be a function which resolves to the desired element.
7878
* `pinStart` — height in px where the header should start and stop pinning. Useful when you have another element above Headroom component.
79+
* `tag` - change the wrapper with the tag of your choice.

0 commit comments

Comments
 (0)