You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know why when I click to delete the item, nothing happens, so when I refresh the page, the item will now be deleted. And when I delete second time and refresh, the first Item will be restored. I want to delete progressively without refresh the page. Thank you
`import React, { useState, useEffect } from 'react'
import notifications from '../mock/notifications.json'
import Localbase from 'localbase'
export default function Notification() {
const [data, setData] = useState([])
You are deleting the item from the database but you don't fetch and get a collection again.
Changing it in the database won't mean it has changed in your component.
You could delete it from the database and then remove it from an object array so that way your component AND the database.
Another way is to delete it from the database and just call the 'db.collection.xxxxxxx.get()' again
I don't know why when I click to delete the item, nothing happens, so when I refresh the page, the item will now be deleted. And when I delete second time and refresh, the first Item will be restored. I want to delete progressively without refresh the page. Thank you
`import React, { useState, useEffect } from 'react'
import notifications from '../mock/notifications.json'
import Localbase from 'localbase'
export default function Notification() {
const [data, setData] = useState([])
}`
The text was updated successfully, but these errors were encountered: