scrimba
Styled Components
Nesting
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
Nesting
Expand for more info
components
Button.js
run
preview
console
import React from 'react'
import ReactDOM from 'react-dom'
import styled from 'styled-components'

const StyledButton = styled.button`
background-color: ${({primary}) => primary? 'red' : 'blue'};
display: flex;
justify-content: center;
padding: 5px;
margin: 5px;
border-radius: 15px;
flex-direction: column;
`

const Button = ({text, primary}) => {
return (
<StyledButton primary={primary}>{text}</StyledButton>
)
}

export default Button
Console
/index.html
-4:03