This does not work. It throws some exceptions.
useLoadable(cursor);
useWatchable(cursor, ['activeTableId', 'selectedRecordIds']);
const table = base.getTableById(cursor.activeTableId);
const record = useRecordById(table, cursor.selectedRecordIds[0]);
This works. But is this the correct way to do it? Feels like there should be a much simpler way to do this.
useLoadable(cursor);
useWatchable(cursor, ['activeTableId', 'selectedRecordIds']);
const table = base.getTableById(cursor.activeTableId);
const queryResult = table.selectRecords();
let record = null;
try {
record = queryResult.getRecordById(cursor.selectedRecordIds[0]);
} catch (e) {
record = null;
}