We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a0dec2e + 3e24240 commit 121fa8eCopy full SHA for 121fa8e
src/components/tree/Tree.tsx
@@ -75,7 +75,7 @@ const Tree: FC<Props> = ({ data, treeId }: Props) => {
75
useEffect(() => {
76
if (!firebase) return;
77
const ref = firebase.database().ref(`stars/${treeId}`);
78
- ref.on("value", (snapshot) => setStar(snapshot.val()));
+ ref.on("value", (snapshot) => setStar(snapshot.val() || {}));
79
return () => {
80
ref.off();
81
};
0 commit comments