Note: Nextjs / Vercel / React related errors and solutions
What are React pure functional components? - LogRocket Blog
// React component
import React from "react";
const ActionButton = ({ label, action }) => {
return <button onClick={action}>{label}</button>;
};
export default ActionButton;
// gain access to the actual HTML element
return (
<button onClick={action} ref={buttonRef}>
{label}
</button>
);
focus()
ko thôi → useImperativeHandle – Reactdiv
in parent, how to “forward” it to its children?
useEffect
👇 Using Async Await Inside React's useEffect() Hook - Ultimate Courses
useEffect(() => {
fetchUsers().then((users) => setUsers(users));
}, []);
if (!users) return <div>Loading...</div>;