ngduc / react-tabulator

React Tabulator is based on tabulator - a JS table library with many advanced features.
https://codesandbox.io/s/0mwpy612xw?module=/src/components/Home.js
MIT License
366 stars 84 forks source link

Type of react-tabulator ref. #233

Closed Maligosus closed 2 years ago

Maligosus commented 3 years ago

What type of React tabulator ref table. image I cannot to access table functions in react tabulator. Its throw error. I don't want use any type without intelliSense

ivanbtrujillo commented 3 years ago

I'm using the following one:

const tableRef = React.useRef<{ table: Tabulator }>()

Then Ican access to function names using tableRef.current.table and It works

p333ter commented 3 years ago

I'm using it very similar, but with the interface:

export interface ITabulator {
  table: Tabulator;
}

const table = React.useRef<ITabulator>();

ngduc commented 3 years ago

Thanks for your inputs. I'll export the interface shortly.