Created
January 29, 2017 04:35
-
-
Save DZuz14/9cb723530d531ce485da076f31716ee7 to your computer and use it in GitHub Desktop.
Slider with conditionals added
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, { Component } from 'react'; | |
import SlideOne from './SlideOne'; | |
import SlideTwo from './SlideTwo'; | |
import SlideThree from './SlideThree'; | |
export default class Slider extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
slideCount: 1 | |
} | |
} | |
render() { | |
return ( | |
<div className="slider"> | |
{/* Slides go here */} | |
{ this.state.slideCount === 1 ? <SlideOne /> : null } | |
{ this.state.slideCount === 2 ? <SlideTwo /> : null } | |
{ this.state.slideCount === 3 ? <SlideThree /> : null } | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment