Skip to content

Commit

Permalink
Use FunctionFieldRenderer type
Browse files Browse the repository at this point in the history
  • Loading branch information
elstgav committed Jun 1, 2023
1 parent f5d017e commit 0d923ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/demo/src/orders/NbItemsField.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react';
import { FunctionField } from 'react-admin';
import { FunctionField, FunctionFieldRenderer } from 'react-admin';
import { Order } from '../types';

const render = (record: Order) => record.basket.length;
const render: FunctionFieldRenderer<Order> = record => record.basket.length;

const NbItemsField = () => <FunctionField<Order> render={render} />;

Expand Down

0 comments on commit 0d923ad

Please sign in to comment.