A 22-year-old man arrested on suspicion of a shooting in which an eight-year-old girl was seriously hurt has been released on bail.