Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

To-do List example throws can not read primaryField on null

Topic Labels: Custom Extensions
Solved
Jump to Solution
432 1
cancel
Showing results for 
Search instead for 
Did you mean: 

I just cloned the to-do list example to get familiar with blocks and it starts with a can not read primaryField of null when compiled.

It’s a small fix with the code i found, this is just if anyone else finds it also for the airtable team to update their sample code.
Since there is no table selected in the beginning of the list table is null therefore need to add in a check for table present before calling table.primaryField.

const records = useRecords(doneField ? view : null, {fields: [table ? table.primaryField : null, doneField]});

{fields: [table ? table.primaryField : null, doneField]}); update this object!
Thank you!

1 Solution

Accepted Solutions

Thanks for posting about this, @Rutvik_Patel! We’ll update the example.

edit: The example is now updated.

See Solution in Thread

1 Reply 1

Thanks for posting about this, @Rutvik_Patel! We’ll update the example.

edit: The example is now updated.