Untitled

mail@pastecode.io avatar
unknown
javascript
2 years ago
373 B
1
Indexable
Never

import { useState } from "react";
export const InputBox = ({getColor}) =>{
const[activeColor, setActiveColor]= useState("");
const handleChange = (e)=>{
const value =e.target;
setActiveColor(value)
getColor(value)
console.log(value)
}
return(
<>
<input type={"text"} style={{display:"block",margin:"20px auto"}}
onChange={handleChange}
value={activeColor}></input>
</>
)
}