question-mark
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.

can i check which component triggers useEffect?

See original GitHub issue

Do you want to request a feature or report a bug? Feature (maybe i’m not sure)

What is the current behavior? Can’t find a way to check “which component/function/method that updates state” from useEffect

What is the expected behavior?

I have a range slider input that takes progress state as value. That progress state updated from <audio>:ontimeupdate() event handler.

I need to arrange range that slider to update progress state. I’m trying to make this with useEffect but when <audio>:ontimeupdate() runs, useEffect gets triggered and slider got stuck.

Can i check what component, function or method changes state and get it from useEffect?

Versions: React: 16.7.0-alpha.0 ReactDOM: 16.7.0-alpha.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
gaearoncommented, Nov 9, 2018

Can you provide a demo please? Like in CodeSandbox.

0reactions
stale[bot]commented, Jan 17, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

In useEffect hook, how to find out what event triggered state ...
The main problem is that state can be changed by multiple events, and I can't tell which event triggered the state change. reactjs...
Read more >
How the useEffect Hook Works (with Examples) - Dave Ceddia
After rendering finishes, useEffect will check the list of dependency values against the values from the last render, and will call your effect ......
Read more >
Using the Effect Hook - React
What does useEffect do? By using this Hook, you tell React that your component needs to do something after render. React will remember...
Read more >
The last guide to the useEffect Hook you'll ever need
With useEffect , you invoke side effects from within functional components, which is an important concept to understand in the React Hooks era....
Read more >
Trigger Effects With useEffect - OpenClassrooms
Use useEffect to perform effects: it lets your component run actions after rendering, choosing when this action should be run. · The hook ......
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found