Last active
December 6, 2016 00:23
-
-
Save homeslicesolutions-zz/51898060165f07d07570963e7f890ecb to your computer and use it in GitHub Desktop.
Stick Container with a Custom Tag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import {StickyContainer} from "react-sticky"; | |
class StickyContainerCustomTag extends StickyContainer { | |
render() { | |
const tagName = this.props.tagName || 'div'; | |
const props = {...this.props}; | |
delete props.tagName; | |
return React.createElement(tagName, props, props.children); | |
} | |
} | |
export default StickyContainerCustomTag; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update to support React 15.2 verification of white-list DOM attributes