As someone who is currently building out some products with Firebase I don't think the cost to swap platform would be too high as long as you isolating your data layer properly.
I'm writing it with om/clojurescript; however, the same would be true for reactjs or any declarative setup. The only code I would need to rewrite would be the read and write hookups to the server.