Skip to main content

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!

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



edit: The example is now updated.


Reply