How can I build a dynamic theme switcher (dark/light mode) using React?
I want to add a feature to my React app that lets users switch between dark and light modes. I’m not sure how to make it work smoothly across the app and save the user’s preference. How can I build a theme switcher in React that updates the theme dynamically?