ways to define datagrid with rows pre-defined
for now I get my rows data from:
const { data: testJobData, isLoading } = useCustom<PostUniqueCheckResponse>({
url:
method: "get",
});
and I defined my datagrid component in this way:
<DataGrid rows={testJobData?.data} columns={columns} autoHeight style={{ marginTop: '16px' }} />
but there is a problem that:
'PostUniqueCheckResponse | undefined' is not assignable to type 'readonly any[]'.
Type 'undefined' is not assignable to type 'readonly any[]'.
Is there something wrong with my usage of datagrid? how can I fix this problem, or could you give me an example of using useCustom to fetch the row data and then apply the row data in a datagrid component initialization
const { data: testJobData, isLoading } = useCustom<PostUniqueCheckResponse>({
url:
${apiUrl}/jobs,method: "get",
});
and I defined my datagrid component in this way:
<DataGrid rows={testJobData?.data} columns={columns} autoHeight style={{ marginTop: '16px' }} />
but there is a problem that:
'PostUniqueCheckResponse | undefined' is not assignable to type 'readonly any[]'.
Type 'undefined' is not assignable to type 'readonly any[]'.
Is there something wrong with my usage of datagrid? how can I fix this problem, or could you give me an example of using useCustom to fetch the row data and then apply the row data in a datagrid component initialization
