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

Question: rowClick throws error in react functional component #264

Open arusikgrigorian opened 2 years ago

arusikgrigorian commented 2 years ago

Environment Details: "react": "^18.1.0", "react-dom": "^18.1.0", "react-tabulator": "^0.18.1",

Issue Description: While clicking on a row apart from getting the required information I'm getting an error. Here it is:

//error Uncaught TypeError: component.getComponent is not a function at Interaction.dispatchEvent (Interaction.js:293:1) at Interaction.handle (Interaction.js:239:1) at InternalEventBus.js:130:1 at Array.forEach () at InternalEventBus._dispatch (InternalEventBus.js:129:1) at InteractionManager.dispatch (CoreFeature.js:78:1) at InteractionManager.triggerEvents (InteractionMonitor.js:302:1) at InteractionManager.track (InteractionMonitor.js:204:1)

//required information //PointerEvent {isTrusted: true, pointerId: 1, width: 1, height: 1, pressure: 0, …} //{title: 'some title', assignees: Array(1), description: '', milestone: 'some milestone', labels: Array(1), …}

Question: How can I fix it or simply not to get that error ?

Code: const Component = () => { //some constants here

const { loading } = useQuery(MY_QUERY { onCompleted: (data) => { //some code here }, onError: (err) => { //some code here }, }

const rowClickHandler = (e, row) => { console.log(e, row.getData()); }

return ( //some checking to display the error component or the loader <> //other components

        <ReactTabulator
         data={data}
         columns={columns}
         events={{ rowClick: rowClickHandler }}
         />

     </>
 )

}

ArtemGoldsmith commented 2 years ago

Having the same issue, any ideas how to fix it?

dborowiec10 commented 1 year ago

Same issue here

HugoP27 commented 1 year ago

Same issue here, any workaround yet?

awatson32 commented 1 year ago

I guess a solution was never found for this?