0
I would like to use props
in a attr
of a component in Styled-Components, that is to say:
export const Button = styled.input.attrs({
type: 'button',
value: `${props => props.value}`
})`
display: flex;
justify-content: center;
align-items: center;
font-weight: 800;
color: black;
background-color: white;
border-radius: 5%;
min-width: 120px;
height: 35px;
margin: 50px;
cursor: pointer;
`
But when I invoke this component with
<Button value={'submit'}/>
is returned the literal value or it creates a button containing as value
a "props => props.value" instead of "Submit".
How to solve this problem?