My react typescript component/codes worked fine in VS2017
with an external react bootstrap table next library but the minute I tried to add the extra paginator feature it just kept giving me this error:
Error: PaginationWrapper.render(): A valid React element (or null) must be returned. You may have returned undefined, an array or some other invalid object.
I have exhausted my search here for a clue on how to define the paginator
ReactJS function inside Visual studio so that typescript could understand and run correctly.
I know this paginator
worked with react as I tested this with:
Inside VS , I attempted to declare the @type
for paginator
in an index.d.ts
as
export default function paginator():void;
This stop VS compiler from complaining, then from my component I just use it like usual but I get error at runtime. my codes:
'import * as React from 'react';'
'import BootstrapTable from 'react-bootstrap-table-next';'
'import paginator from 'react-bootstrap-table2-paginator';'