Devextreme-reactive: GridExporter Missing From TypeScript Definitions

Created on 17 Mar 2020  路  12Comments  路  Source: DevExpress/devextreme-reactive

  • [X ] I have searched this repository's issues and believe that this is not a duplicate.

I'm using ...

  • [ X] React Grid
  • [ ] React Chart
  • [ ] React Scheduler

Current Behavior

Following your example to enable exports of a grid fails for me.

GridExporter is nowhere to be found.

And indeed, navigating to node_modules and the @devexpress/dx-react-grid-export package, there is a blank line in the end of dx-react-grid-export.d.ts.

...

export declare type ExportSummary = {
    type: SummaryType;
    ranges: ExportRanges;
};

export declare type GetCellValueFn = (row: any, columnName: string) => any;

export declare type SummaryType = string;

export { }

This is compared to dx-react-grid-export.es.js which exports the name GridExporter.

            createElement(GridExporterCore, __assign({}, this.props, { exportSelected: selectedOnly }))));
    };
    return GridExporterBase;
}(PureComponent));
var GridExporter = GridExporterBase;

export { GridExporter };
//# sourceMappingURL=dx-react-grid-export.es.js.map

Expected Behaviour

I expected following the steps in the example to work.

Steps to Reproduce

Follow the steps in the guid [here]( your example using 2.5.1, with typescript and strict mode on does not work.

Environment

"@devexpress/dx-react-core": "^2.5.1",
"@devexpress/dx-react-grid": "^2.5.1",
"@devexpress/dx-react-grid-bootstrap3": "^2.5.1",
"@devexpress/dx-react-grid-export": "^2.5.1",
"typescript": "~3.7.2"

__tsconfig__

{
  "compilerOptions": {
    "target": "es5",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react"
  },
  "include": [
    "src"
  ]
}
Grid Typescript declaration bug

All 12 comments

Hello

When will this fix be released?

Thanks
Mark

Hi @markusbellus ,

We expect to release the fix next week.

Great thanks!

Hello again,

I just updated to 2.6.0 and can now find the GridExporter. However the method exportGrid does not seem to be in the typescript definiton. It seems to be on the javacript files.

Is there any other import I have to do?
Would it be possible for you to show this example in a typescript version?

Hi @andrejohansson ,

Thank you for reporting this problem. We'll fix it soon.

Would it be possible for you to show this example in a typescript version?

I've created a typescript version of this example. Here is the link.

Hello @ushkal, I've tried your example...and for some reason I cannot build it. I have copied the package json, tsconfig and your example exactly.

But still I got the following error:

Type '{ ref: MutableRefObject<any>; columns: ({ name: string; title: string; getCellValue: (row: Person) => string | null | undefined; } | { name: string; title: string; getCellValue: (row: Person) => number | ... 1 more ... | undefined; })[]; rows: ({ ...; } & ... 1 more ... & { ...; })[]; onSave: (workbook: any) => void...' is not assignable to type 'IntrinsicAttributes & Pick<GridProps, "columns" | "rows" | "getRowId" | "getCellValue"> & Pick<FilteringStateProps, "filters"> & ... 7 more ... & { ...; }'.
  Property 'ref' does not exist on type 'IntrinsicAttributes & Pick<GridProps, "columns" | "rows" | "getRowId" | "getCellValue"> & Pick<FilteringStateProps, "filters"> & ... 7 more ... & { ...; }'.  TS2322

    203 |         </Grid>
    204 |         <GridExporter        
  > 205 |             ref={exporterRef}
        |             ^
    206 |             columns={columns}
    207 |             rows={guests}
    208 |             onSave={onSave}

Then I noticed that your example was using typescript. 2.7.2 but I used typescript: 3.7.2, so I tried to downgrade, but no luck.

I do not understand why your sample works even though it has the same error?

image

was this issue resolved, I am facing the same issue

@alon-green I have not seen any solution yet unfortunately

Why is this issue marked as closed? I am attempting to add GridExporter to a typescript file but am having the same issue. I see that the branch from @MaksimKonyaev was merged to master. Has the fix not been published yet? I tried uninstalling @devexpress/dx-react-grid-export and re-installing but am still seeing the issue.

Hi @Dane2259,

It means that the necessary code is in the master branch. The fix will be published with our next release. We are working on it now.

Hi @andrejohansson, @Dane2259, @alon-green, @markusbellus,

We have released the 2.6.3 version of DevExtreme Reactive with this fix. I've created a typescript version of this example. Here is the link.

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

acentfrio picture acentfrio  路  3Comments

sintuchintu picture sintuchintu  路  3Comments

zcuric picture zcuric  路  3Comments

bloolizard picture bloolizard  路  3Comments

madebymt picture madebymt  路  3Comments