Untitled

 avatar
unknown
javascript
3 years ago
373 B
3
Indexable

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>
</>
)
}
Editor is loading...