How can I use IndexFilter from Polaris in jsx?

How can I use IndexFilter from Polaris in jsx?

Devejo
Shopify Partner
18 0 5

Currently wanting this IndexFilter feature from Polaris but I'm not sure how to use it in javascript because it is documentated only on how to use in TypeScripts at the moment.

 

Current issue that I'm facing is how to convert this to javascript:

import type {IndexFiltersProps} from '@shopify/polaris';

const sortOptions: IndexFiltersProps['sortOptions'] = [
    {label: 'Order', value: 'order asc', directionLabel: 'Ascending'},
    {label: 'Order', value: 'order desc', directionLabel: 'Descending'},
    {label: 'Customer', value: 'customer asc', directionLabel: 'A-Z'},
    {label: 'Customer', value: 'customer desc', directionLabel: 'Z-A'},
    {label: 'Date', value: 'date asc', directionLabel: 'A-Z'},
    {label: 'Date', value: 'date desc', directionLabel: 'Z-A'},
    {label: 'Total', value: 'total asc', directionLabel: 'Ascending'},
    {label: 'Total', value: 'total desc', directionLabel: 'Descending'},
  ];

can anyone knows how to use it in JSX?

 

Thanks in advance.

 

 

Replies 0 (0)