Custom hook là JavaScript function bắt đầu bằng 'use' có thể gọi các hooks khác. Dùng để tái sử dụng stateful logic giữa components. Mỗi component sử dụng custom hook có state instance riêng biệt, không chia sẻ.
Ví dụ: function useLocalStorage(key, initial) { const [value, setValue] = useState(...); return [value, setValue]; }.