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

Fixed infinite api calls in a story #112

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kailash360
Copy link
Member

Issue Number

fixes #105

Describe the changes you've made

I have added the React useEffect hook in the commentForm component where all the users of the application are fetched. Previously, without the hook, the state was updated at each call, and this caused the component to re-render for every call. This led to infinite API calls to the backend. After this fix a request is made to the backend only once which is sufficient to fetch all the users.

Describe if there is any unusual behavior (Any Warning) of your code(Write NA if there isn't)

NA

Additional context (OPTIONAL)

NA

Test plan (OPTIONAL)

A good test plan should give instructions that someone else can easily follow.

NA

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • The title of my pull request is a short description of the requested changes.

Provide a Deployed link of route/page that needs to review

Preview: Deploy preview link here with the appropriate route

NA

@kailash360
Copy link
Member Author

@kbhutani0001 @mharshita
This PR can be closed since the issue has been tackled in PR 117

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.

Infinite API calls
2 participants