There are on-demand electric water heaters available. The electric consumption is too large for virtually any realistic RV application.
Here is information on one such unit, a pretty small model. Note that it uses 50A at 240V, an entire 50A RV power supply, and only gives a 40 degree temperature rise at 2.1 gpm. I would guess that you would typically have a larger temperature rise and need a correspondingly slower flow rate...and not be able to use any other electrical devices in your RV, and probably not be able to power it at all from your generator.