I wonderred the same thing, so....
What I did was take 2 pieces of wood (widest shelving or 3/4" G1S Plywood) for the sides and screwed cleats into them at whatever height I wanted... Then set them into place and measured the shelves and cut each one to fit.. Set them into place.. Never had an issue of them falling out or over.. Just don't make the shelves too tight or too loose... Too tight and they won't expand with humidity changes.. Too loose, well you can see what could happen..
That way if you decide to sell the unit or convert it back to a wardrobe or closet there are no holes to fill/hide in the walls...The one thing I didn't do, since we had extra paint for the closet interior walls, was to put a felt or cloth backing on the boards...
Camped 2016 (Days/Nights) - 32/23
Nights camped 2015 - 29
TT: 2013 26' Revere TBQB
TV: 2014 GMC Sierra 1500 Z71 4x4