Liam Hales
Senior Software Engineer
TypeScript
React
November 2021 - 3 years ago
React
useEffect
useLayoutEffect
useEffect
useLayoutEffect
DOM
useEffect
useLayoutEffect
useEffect
useLayoutEffect
DOM
useLayoutEffect
useEffect
const App: FunctionComponent = (): ReactElement => {
const [text, setText] = useState('Loading...');
useEffect(() => {
setText('Hello World!');
}, []);
return (
<p>{text}</p>
);
};
Loading...
Hello World!
DOM
useEffect
Loading...
useLayoutEffect
useEffect
DOM
Loading...
useLayoutEffect(() => {
setText('Hello World!');
}, []);
useEffect
useEffect
useLayoutEffect