Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I use two 'ref' methods from firebase?

I am using react js + firebase's realtime database and storage. I want to store an image and text contents to storage and realtime database respectively.

import {getDatabase, ref, set} from "firebase/database";
import {getStorage, ref} from "firebase/storage";

There was an error. I cannot import two 'ref' methods in same page.

Identifier 'ref' has already been declared. (32:22)
like image 389
pandorao liger Avatar asked Aug 30 '26 16:08

pandorao liger


1 Answers

import {getDatabase, ref as ref_database, set} from "firebase/database";
import {getStorage, ref as ref_storage} from "firebase/storage";
like image 191
Emil Karlsson Avatar answered Sep 01 '26 04:09

Emil Karlsson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!