My styled component:
const Button = styled.button
/* Adapt the colors based on primary prop */
background: ${props => props.primary ? "grey" : "white"};
color: ${props => props.primary ? "white" : "grey"};
font-size: 1em;
margin: 1px;
padding: 0.25em 1em;
border: 1px solid grey;
cursor: pointer;
border-radius: 3px;
`;`
And this is my return
return (
<div className="App">
<Button >Lunch</Button>
<Button primary>Dinner</Button>
</div>
</div>
)
the button look like this the button when the button "Lunch" click design button swap with "Dinner", how to make button onclik (like button active and inactive), i'm newbie with reactjs and styled-component.