There is a noun and a pronoun also, so it can easily be the object of a preposition: We went across there,He put it under there , etc. In your sentence, there refers to the bed.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.