This is the example code for this article:
https://dev.to/namick/why-you-should-be-writing-your-own-react-hooks-23an
Custom React hooks can provide a great place to draw a boundary between imperative and declarative code.
In this example, we'll look at extracting essential complexity into composable, encapsulated, reusable objects while keeping your components clean and declarative.
View it on CodeSandbox:
https://codesandbox.io/s/github/namick/stopwatch-timer-example