You can learn electronics and CS together if you are interested in it. However, that is not my question.
What is the importance of electronics in CS? Yes, that’s one. Today, we rely on silicon-based electronics to build computers. If you are interested in electronics, you can understand the architecture of computers. You will then be able improve it and even use other technologies, which are not silicon, to create new architectures. It is an answer in the sense of invention.