For 3xAA NiMH and a 5V solar panel, you need just a diode, which prevents the batteries from discharging through the solar panel at night.
NiMH batteries can be "trickle charged" for long periods of time with little or no damage, but to learn the gory details, consult batteryuniversity.com
For example, start here: BU-203: Nickel-based Batteries - Battery University