Skip to content

Instantly share code, notes, and snippets.

@bala020304
Created November 9, 2016 00:08
Show Gist options
  • Save bala020304/5055ee90560076eb36e223d88d1dd85b to your computer and use it in GitHub Desktop.
Save bala020304/5055ee90560076eb36e223d88d1dd85b to your computer and use it in GitHub Desktop.
tabs
  • i have simple tabs code
  • i am trying to move the tabs container inside my li tag, since its a new requirement
  • i tried but its working partially.
  • now the same tab content is displaying twice
  • can you guys tell me how to fix it.
  • providing my code below.


      _renderTitles: function () {
      	function labels(child, index) {
        	var activeClass = (this.state.selected === index ? 'active' : '');
     
        	return (
          	<li role="presentation" key={index} className={child.props.liClass}>
            	<a href="#" 
              	className={`sports-tab-header ${activeClass}`}
              	onClick={this.handleClick.bind(this, index)}>
              	<h2>{child.props.label}</h2>
                <p className="sports-subtitle">{child.props.subtitle}</p>
              </a>
            </li>
          );
        }
      	return (
        	<ul className="tabs__labels">
          	{this.props.children.map(labels.bind(this))}
          </ul>
        );
      },
      

not working fiddle https://jsfiddle.net/9e767txs/22/

working fiddle https://jsfiddle.net/9e767txs/9/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment