For small apps → Context API is fine. But, there is some performance issues, If the theme state updates, all consuming components re-render, which may affect performance.If you are looking for alternative you can checkout the below options ,
For better performance (avoiding re-renders) → Use Zustand.