Latest version doesn't compile with typescript
Describe the bug Project with typescript can't be compiled because of a bad index.d.ts
To Reproduce Compiling anything in typescript using the component involves:
xxxxxxxxxxxxxxxxxxxxx/node_modules/material-table/types/index.d.ts
(155,9): Cannot find name 'ForwardRefExoticComponent'.
Indeed, ForwardRefExoticComponent, RefAttributes, and SVGSVGElement mentioned in the commit https://github.com/mbrn/material-table/commit/ff6319a5af45ca567b5c85b67b73408cebc95a53 are declared nowhere in index.d.ts:
https://github.com/mbrn/material-table/blob/2ef098595fe3c2b8d2f69a1f47193fc3a5756d88/types/index.d.ts#L1-L3
https://github.com/mbrn/material-table/blob/2ef098595fe3c2b8d2f69a1f47193fc3a5756d88/types/index.d.ts#L154-L172
I am also seeing an issue when compiling. VSCode does not complain, but TSLint is not liking it:
../../node_modules/material-table/types/index.d.ts:155:9 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
155 Add?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:155:35 - error TS2304: Cannot find name 'RefAttributes'.
155 Add?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:156:11 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
156 Check?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:156:37 - error TS2304: Cannot find name 'RefAttributes'.
156 Check?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:157:11 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
157 Clear?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:157:37 - error TS2304: Cannot find name 'RefAttributes'.
157 Clear?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:158:12 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
158 Delete?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:158:38 - error TS2304: Cannot find name 'RefAttributes'.
158 Delete?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:159:17 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
159 DetailPanel?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:159:43 - error TS2304: Cannot find name 'RefAttributes'.
159 DetailPanel?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:160:10 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
160 Edit?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:160:36 - error TS2304: Cannot find name 'RefAttributes'.
160 Edit?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:161:12 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
161 Export?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:161:38 - error TS2304: Cannot find name 'RefAttributes'.
161 Export?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:162:12 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
162 Filter?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:162:38 - error TS2304: Cannot find name 'RefAttributes'.
162 Filter?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:163:15 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
163 FirstPage?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:163:41 - error TS2304: Cannot find name 'RefAttributes'.
163 FirstPage?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:164:15 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
164 SortArrow?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:164:41 - error TS2304: Cannot find name 'RefAttributes'.
164 SortArrow?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:165:14 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
165 LastPage?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:165:40 - error TS2304: Cannot find name 'RefAttributes'.
165 LastPage?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:166:14 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
166 NextPage?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:166:40 - error TS2304: Cannot find name 'RefAttributes'.
166 NextPage?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:167:18 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
167 PreviousPage?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:167:44 - error TS2304: Cannot find name 'RefAttributes'.
167 PreviousPage?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:168:17 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
168 ResetSearch?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:168:43 - error TS2304: Cannot find name 'RefAttributes'.
168 ResetSearch?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:169:12 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
169 Search?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:169:38 - error TS2304: Cannot find name 'RefAttributes'.
169 Search?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:170:21 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
170 ThirdStateCheck?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:170:47 - error TS2304: Cannot find name 'RefAttributes'.
170 ThirdStateCheck?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:171:16 - error TS2304: Cannot find name 'ForwardRefExoticComponent'.
171 ViewColumn?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/material-table/types/index.d.ts:171:42 - error TS2304: Cannot find name 'RefAttributes'.
171 ViewColumn?: ForwardRefExoticComponent<RefAttributes<SVGSVGElement>>;
~~~~~~~~~~~~~
@mviens , The component compiles because it is written in javascipt, not in typescript. The d.ts is just embedded as is in the bundle and doesn't make part of any compilation during the build process. The only moment when it's ever used is when the typescript application that uses the component is being compiled.
I have this issue too.
@mbrn - Could we please get a response on this? This prevents me from using this component.
@mviens take version 1.39.0 while it is being solved. (FYI, @mbrn is a private person who makes this component on his free time and shares it with us, it is not an editor who owes you anything ;) )