How to add Dark mode functionality with React Hooks

Many developers love dark mode in an app, whether it is running on a mobile device or inside a web browser. A lot of popular websites like Twitter, Reddit, and YouTube are now supporting this feature on their websites and applications. It is more than a trend, and appealing to the end user's eyes that makes the user experience comforting by decreasing the problem of eye fatigue.

This is a companion discussion topic for the original entry at