Skip to content

Commit

Permalink
moving value to useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldoglas committed Oct 9, 2024
1 parent 9e481eb commit 084aaac
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/Expensify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,19 +145,17 @@ function Expensify() {
// Initialize this client as being an active client
ActiveClientManager.init();

// Initialize Fullstory lib
FS.init(userMetadata);

// Used for the offline indicator appearing when someone is offline
const unsubscribeNetInfo = NetworkConnection.subscribeToNetInfo();

return unsubscribeNetInfo;

// This would alerting because of userMetadata. We'll remove the linter rule since
// we don't really need to run this effect again if that value changes.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

useEffect(() => {
// Initialize Fullstory lib
FS.init(userMetadata);
}, [userMetadata]);

// Log the platform and config to debug .env issues
useEffect(() => {
Log.info('App launched', false, {Platform, CONFIG});
Expand Down

0 comments on commit 084aaac

Please sign in to comment.