Using React Context the Right Way

In Custom Hooks Worth Writing, I made the case for extracting logic into hooks only once you've written the same pattern three or four times, not on the first sighting of duplication.