Last active
April 17, 2017 15:11
-
-
Save lvarayut/daaa88fdd1b5855f100369ae8f499f35 to your computer and use it in GitHub Desktop.
Step-2 Use prop to set Title color
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 styled from 'styled-components'; | |
const mainColor = 'indianred' | |
const Title = styled.h1` | |
color: ${props => props.color || 'goldenrod'} | |
`; | |
class App extends Component { | |
render() { | |
return ( | |
<Title color={mainColor}>Mystagram</Title> | |
); | |
} | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment