Help

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

Solved
Jump to Solution
688 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Rutvik_Patel
4 - Data Explorer
4 - Data Explorer

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
Emma_Yeap
Airtable Employee
Airtable Employee

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
Emma_Yeap
Airtable Employee
Airtable Employee

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

edit: The example is now updated.