هذا الدرس بالإنجليزية حاليًا.
Write the logic once
The status bar and the send button both need to know whether the user is online, with the same state and the same effect. Copy and paste works until one copy gets a fix and the other does not. Custom hooks let you write that logic once.