Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom sorting indicator templates don't work #82

Open
fvitolo opened this issue Aug 21, 2024 · 0 comments
Open

Custom sorting indicator templates don't work #82

fvitolo opened this issue Aug 21, 2024 · 0 comments
Labels
🐛 bug Something isn't working

Comments

@fvitolo
Copy link

fvitolo commented Aug 21, 2024

Description

Trying to set up a custom sorting indicator template as described in the guide in section https://www.infragistics.com/products/ignite-ui-react/react/components/grids/grid/sorting#sorting-indicators-templates, I get the following type mismatch error: ....

TS2322: Type
(ctx: IgrGridHeaderTemplateContext) => Element
is not assignable to type
FunctionComponent<{ dataContext: IgrGridHeaderTemplateContext; }> | Component<{ dataContext: IgrGridHeaderTemplateContext; }, {}, any> | undefined
Type
(ctx: IgrGridHeaderTemplateContext) => Element
is not assignable to type
FunctionComponent<{ dataContext: IgrGridHeaderTemplateContext; }>
Types of parameters  ctx  and  props  are incompatible.
Type
PropsWithChildren<{ dataContext: IgrGridHeaderTemplateContext; }>
is missing the following properties from type  IgrGridHeaderTemplateContext :
createImplementation, _implementation, mounted, nativeElement , and  7  more.
igr-grid-base-directive.d.ts(1401, 5): The expected type comes from property  sortHeaderIconTemplate  which is declared here on type
IntrinsicAttributes & IntrinsicClassAttributes<IgrGrid> & Readonly<IIgrGridProps> & Readonly<...>

When I try to use a React.FunctionComponent like this

    const sortHeaderIconTemplate: React.FunctionComponent<{
      dataContext: IgrGridHeaderTemplateContext;
    }> = ({ dataContext }) => {
      console.log(dataContext);
      return 
         <>
            <IgrIcon name='unfold_more'></IgrIcon>
        </>;
    };

instead, I receive the following error in the console:

runtime.js:101 ERROR 
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: null.

Check the render method of `IgrGrid2`.

What is the correct way to use this property?

@fvitolo fvitolo added the 🐛 bug Something isn't working label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant