Skip to content

Commit

Permalink
moved props & added doc
Browse files Browse the repository at this point in the history
  • Loading branch information
dbilgin committed Dec 1, 2020
1 parent 511b9d4 commit e49caae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export default class Headroom extends Component {
}

render () {
const { className: userClassName, ...divProps } = this.props
const { className: userClassName, tag: Tag, ...divProps } = this.props
delete divProps.onUnpin
delete divProps.onPin
delete divProps.onUnfix
Expand Down Expand Up @@ -395,8 +395,6 @@ export default class Headroom extends Component {
? `${userClassName} headroom-wrapper`
: 'headroom-wrapper'

const { tag: Tag } = this.props

return (
<Tag style={wrapperStyles} className={wrapperClassName}>
<div
Expand Down
1 change: 1 addition & 0 deletions www/pages/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@ Another option is to use CSS. The component has a `headroom` class as well as a
* `wrapperStyle` — pass styles for the wrapper div (this maintains the components vertical space at the top of the page).
* `parent` — provide a custom 'parent' element for scroll events. `parent` should be a function which resolves to the desired element.
* `pinStart` — height in px where the header should start and stop pinning. Useful when you have another element above Headroom component.
* `tag` - change the wrapper with the tag of your choice.

0 comments on commit e49caae

Please sign in to comment.