score:1

Accepted answer
type propsInputText ={
  width:string;
}

const TextBox = styled.input`
    width:${props => props.width? props.width : '30px;'}  
`

function InputText(props: propsInputText) {
    console.log("InputText Props = "+props.width);
    return (
          <TextBox width={props.width} />    //here I need to add the props
    )
}

export default InputText

score:0

<>
    <InputBox width={100} color={"white"} background={"black"} height={"10"} />
    <InputBox />
</>

Related Query

More Query from same tag