- 3

im really stuck on this question anyone help?

function Search(props) { const [val, setVal] = useState( props .q); <div> <input type="text" value={val} /> <button>Search</button> </div>; }

21st Nov 2020, 8:24 PM
Miss Bianka R Morris
Miss Bianka R Morris - avatar
4 Answers
+ 3
first of all, you have already defined your function. you need to access q through props (props.q) and return the dive element function Search(props) { const [val, setVal] = useState(props.q); return <div> <input type="text" value={val} /> <button>Search</button> </div>; }
8th Dec 2020, 5:48 AM
Arman Karimi
Arman Karimi - avatar
+ 2
what exactly do you need help with?
21st Nov 2020, 9:50 PM
Abhay
Abhay - avatar
0
function props return
22nd Sep 2022, 8:48 AM
LIPSA BEHERA
0
function Search(props) { const [val, setVal] = useState( props .q); return <div> <input type="text" value={val} /> <button>Search</button> </div>; }
3rd Nov 2022, 10:55 PM
Ahmed Khaled Sobhi
Ahmed Khaled Sobhi - avatar