Skip to content

Commit

Permalink
Fix: App component UseEffect infinite loop (#1199)
Browse files Browse the repository at this point in the history
### Motivation and Context

<!-- Thank you for your contribution to the chat-copilot repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
The useEffect hook in the App component is causing an infinite rendering
loop. Remove the dependencies that are causing the loop.


### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [ ] The code builds clean without any errors or warnings
- [ ] The PR follows the [Contribution
Guidelines](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/chat-copilot/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [ ] All unit tests pass, and I have added new tests where possible
- [ ] I didn't break anyone 😄
  • Loading branch information
TaoChenOSU authored Oct 31, 2024
1 parent 7b27658 commit f2f4a32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webapp/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ const App = () => {
}
}),
]);
}
}, [instance, isAuthenticated, appState, isMaintenance, handleAppStateChange, dispatch, chat, file]);
} // eslint-disable-next-line react-hooks/exhaustive-deps
}, [instance, isAuthenticated, appState, isMaintenance]);

const theme = features[FeatureKeys.DarkMode].enabled ? semanticKernelDarkTheme : semanticKernelLightTheme;

Expand Down

0 comments on commit f2f4a32

Please sign in to comment.