Lots of folk have done that in fact.
There are certain vans that are setup in the factory to do that.
For others, if you have a a fridge that has AES (Automatic Energy Selection), you can do a setup where an inverter will switch on, or a mains relay will enable, when the battery is at a certain state of charge and then turn off again when the battery has dropped to a certain lower state of charge.
You can also use the same principle to heat the hot water via AC rather than Gas. This is what I do in my Motorhome if I have spare power, as my Fridge/Freezer is all-electric
If you want to read a bit more, you can check out the following Blog entry on my website which goes into some detail. Note this was written some years go before I changed my fridge from a 3-way to a Compressor model, so does discuss Fridge and Water.
PS. For anyone who says using an inverter is inefficient, wasting say 10% of power by converting 12V to 240V is going to be a lot more efficient than wasting 100% of excess solar power by having no route for it to be used.