Ich möchte eine Eigenschaft für die Rückkehr gestylt Schaltfläche verwenden. Ich suche etwas ähnliches:ReactJs StyledComponents
const Button = styled.button`
/* Adapt the colors based on primary prop */
background: ${props => props.primary ? 'palevioletred' : 'white'};
color: ${props => props.primary ? 'white' : 'palevioletred'};
font-size: 1em;
margin: 1em;
padding: 0.25em 1em;
border: 2px solid palevioletred;
border-radius: 3px;
`;
export default Button;
Leider habe ich mehr als 2 Requisiten basierend auf dem ich gestylt Komponente zurückgeben müssen.
https://www.webpackbin.com/bins/-Kfp3u_EKAAHEqkAeVcL –