Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: rowClick throws error in react functional component #264

Open
arusikgrigorian opened this issue Jul 6, 2022 · 4 comments
Open

Comments

@arusikgrigorian
Copy link

arusikgrigorian commented Jul 6, 2022

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
Copy link

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

@dborowiec10
Copy link

Same issue here

@HugoP27
Copy link

HugoP27 commented May 16, 2023

Same issue here, any workaround yet?

@awatson32
Copy link

I guess a solution was never found for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants