-2
Hello, I have a question about how to use attributes in a component created in React. Imagine that I created the following component:
const AnimatedInput = ({ label, type }) => {
return (
<div className='animatedInput'>
<input name={label} className='animatedInput__input' type={type} required />
<span className='animatedInput__span'>{label}</span>
</div>
)
}
Now when I use this component elsewhere in my application I call it normally:
<AnimatedInput label={'Nome'} type={'text'}/>
My question is, and if I want to pass proper attributes of input(for example) within this tag, it has how to do this ?
I know that in Typescript we can extend these attributes, but in this case I am not using Typescript.
Thanks for your help.
Thanks for the answer
– MSpilari06