Skip to content

Conversation

@pmustonebi
Copy link
Contributor

@pmustonebi pmustonebi requested a review from Isaac1m October 24, 2025 09:42
@Isaac1m
Copy link
Contributor

Isaac1m commented Oct 24, 2025

  • The uninitialised states (liveData and onDemandData) might cause issues like trying to access properties of undefined.

  • In the first useEffect, the dependency array includes the two state variables mentioned above. Since they're both also being set inside this useEffect, this will probably keep re-triggering the effect every time the state changes (and re-rendering the component), creating a potential infinite re-render loop (or at least unnecessary repeated API calls).

@pmustonebi
Copy link
Contributor Author

  • The uninitialised states (liveData and onDemandData) might cause issues like trying to access properties of undefined.
  • In the first useEffect, the dependency array includes the two state variables mentioned above. Since they're both also being set inside this useEffect, this will probably keep re-triggering the effect every time the state changes (and re-rendering the component), creating a potential infinite re-render loop (or at least unnecessary repeated API calls).

Thanks for your feedback! You're clearly more experienced in React than me ;) Hopefully the fix I've implemented has improved it

@pmustonebi pmustonebi merged commit 4d7f22f into master Oct 29, 2025
2 checks passed
@pmustonebi pmustonebi deleted the add-training-widget-to-homepage branch October 29, 2025 11:05
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

Successfully merging this pull request may close these issues.

3 participants