- 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>; }
4 ответов
+ 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>;
}
+ 2
what exactly do you need help with?
0
function
props
return
0
function
Search(props) {
const [val, setVal] = useState(
props
.q);
return
<div>
<input type="text" value={val} />
<button>Search</button>
</div>;
}