I am trying to implement a storage LiveObject, when I try to modify it using set method, inside useMutation hook, it gives error "TypeError: thisCentralCard.set is not a function" :
Below is the useMutation hook I tried implementing, which is similar to the example shown in liveblocks storage tutorial.
const updateCentralCard = useMutation(({ storage }, newCard: Card) => {
const thisCentralCard = storage.get("centralCard") as LiveObject<{color: string, value: string}>;
console.log(thisCentralCard)
thisCentralCard.set("color", newCard.color);
thisCentralCard.set("value", newCard.value);
}, []);
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745665450a4639095.html
评论列表(0条)