Created
February 9, 2017 14:41
-
-
Save diegocasmo/09867cc0de31ae4148a736dbfb2b1b17 to your computer and use it in GitHub Desktop.
Implementation of a <Tab/> component in React
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
export const Tab = (props) => { | |
return ( | |
<li className="tab"> | |
<a className={`tab-link ${props.linkClassName} ${props.isActive ? 'active' : ''}`} | |
onClick={(event) => { | |
event.preventDefault(); | |
props.onClick(props.tabIndex); | |
}}> | |
<i className={`tab-icon ${props.iconClassName}`}/> | |
</a> | |
</li> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source code for full implementation (including tests) can be found here: https://gist.github.com/diegocasmo/5cd978e9c5695aefca0c6a8a19fa4c69