mirror of
https://github.com/supabase/supabase.git
synced 2026-10-13 13:19:09 +03:00
* feat: drop file to import data In the Table Editor for an empty table, make the entire grid area a dropzone so that files can be dropped onto the grid area for importing. Dropping a file opens the SpreadsheetImport side panel with the dropped file already loaded. * refactor: drag and drop file import Refactor logic into hooks and utility functions * refactor: file drop import Small changes caught in code review * Opt to pass file through valtio store instead of event listener * refactor: telemetry properties + cleaning up hook deps --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
13 lines
233 B
TypeScript
13 lines
233 B
TypeScript
import { useEffect, useRef } from 'react'
|
|
|
|
export function useChanged<T>(value: T): boolean {
|
|
const prev = useRef<T>()
|
|
const changed = prev.current !== value
|
|
|
|
useEffect(() => {
|
|
prev.current = value
|
|
})
|
|
|
|
return changed
|
|
}
|