feat(frontend): added another defensive error `Records` component

pull/85/head
Samuel Rowe 3 years ago
parent 73a137bae2
commit c84c91dc20

@ -129,6 +129,10 @@ const Records: FunctionComponent<IRecordsProps> = (
throw new Error(`"${name}" is falsy.`); throw new Error(`"${name}" is falsy.`);
} }
if (!Array.isArray(items)) {
throw new Error(`Expected "${name}" to be an array.`);
}
const empty = items && items.length === 0; const empty = items && items.length === 0;
return ( return (

Loading…
Cancel
Save