Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

callbacks do not change across renders

See original GitHub issue

Hi there,

I might be missing something obvious, but can I access render props from getters/renderers? My dataGetter cellRenderer don’t seem to update, even if they’re declared as anonymous functions, and see the same initial props at each subsequent render. Intended?


Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:21

github_iconTop GitHub Comments

sklinovcommented, Jul 7, 2021

Hi, @nihgwu ! I think I’m facing the same issue when I’m trying to pass some async stuff to cellRenderer and it looks like BaseTable is using the first closure of it.

Can you help with any universal workaround for it until the next major release?

Read more comments on GitHub >

github_iconTop Results From Across the Web

React component not rendering after state change from callback
If the state is changed from within the page, everything is fine. When the state is updated via the callback from the child...
Read more >
Avoiding Accidental Re-Renders with the useCallback Hook
Because the functions are re-created on every single render, the reference to that function changes. And each time it changes when it's used...
Read more >
5 Ways to Avoid React Component Re-Renderings
In the above example, useCallBack() memoizes the onClick callback. So, it will not re-render the component if the user clicks the same item...
Read more >
React re-renders guide: everything, all at once - Developer way
When a component's state changes, it will re-render itself. Usually, it happens either in a callback or in useEffect hook. State changes are...
Read more >
The render() method is the only required method in a class component. ... The render() function should be pure, meaning that it does...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found