you don't grow out of nightmares per say, nightmares work the same as dreams where the is no meaning behind them, it's just random neurones firing in the brain. people usually have 5 dreams a night, but just dont remember them, it's entirely possible that your brain just chooses not to remember the unpleasant ones.
at any rate, i'm 19 and i still have the occasional nightmare, people probably just forget them because now they know a nightmare can't hurt them, while as a child you still have that kind of residual fear, so you remember them more vividly.