This is a simulation of simple electrical circuits in React. It treats electrical components as objects with native methods. So, when you run a circuit, the circuit component invokes each child component's corresponding charge and ground methods via ref callbacks.
I have since discovered that this is frowned upon and ref callbacks may be deprecated.