div
// Alternative HTML tags to <div> <section/> <article/> <main/> <aside/> // empty element in JSX <></>
Chaining useRef
and useEffect
together, you can reference the element.
import {useEffect, useRef} from "react"; function Foo() { const inputEl = useRef(null); useEffect(() => { // do something with `inputEl` here }, []); return <Bar ref={inputEl} /> }
properties
vs attributes
<input type="text" value="Hello" />
const input = document.querySelector("input"); input.value = "Goodbye"; // value property