Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion hello-world-tab-with-backend/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
},
"devDependencies": {
"env-cmd": "^10.1.0",
"typescript": "^4.4.4"
"@types/node": "^20.17.12",
"typescript": "^5.6.3"
},
"main": "dist/src/functions/*.js"
}
8 changes: 4 additions & 4 deletions hello-world-tab-with-backend/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"module": "NodeNext",
"target": "ES2022",
"outDir": "dist",
"rootDir": ".",
"sourceMap": true,
"strict": false,
"typeRoots": ["./node_modules/@types"],
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"moduleResolution": "nodenext",
"moduleResolution": "NodeNext"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ export function useData<T>(
.catch((error) => dispatch({ type: "error", error }));
}
useEffect(() => {
// Intentionally run only once on mount to auto-fetch initial data.
// We don't want to re-fetch when `auto` or `reload` changes.
if (auto) reload();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return { data, loading, error, reload };
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ export function useTeams(options?: {
? options.setThemeHandler
: themeChangeHandler;
useEffect(() => {
// set initial theme based on options or query string
// Intentionally run only once on mount to initialize Teams SDK and register event handlers.
// Teams SDK initialization and event registration should not be repeated on re-renders.
// The initial theme is captured once via useState, so it won't cause stale closure issues.

// Set initial theme based on options or query string
if (initialTheme) {
overrideThemeHandler(initialTheme);
}
Expand Down Expand Up @@ -100,10 +104,11 @@ export function useTeams(options?: {
setLoading(false);
setInTeams(false);
});
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);

return [
{ inTeams, fullScreen, theme, context, themeString, loading },
{ setTheme: overrideThemeHandler },
];
}
}
3 changes: 2 additions & 1 deletion intelligent-data-chart-generator/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
},
"devDependencies": {
"env-cmd": "^10.1.0",
"typescript": "^4.9.5"
"@types/node": "^20.17.12",
"typescript": "^5.6.3"
},
"main": "dist/src/functions/*.js"
}
10 changes: 4 additions & 6 deletions intelligent-data-chart-generator/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"module": "NodeNext",
"target": "ES2022",
"outDir": "dist",
"rootDir": ".",
"sourceMap": true,
"strict": false,
"esModuleInterop": true,
"resolveJsonModule": true,
"typeRoots": [
"./node_modules/@types"
],
"typeRoots": ["./node_modules/@types"],
"allowSyntheticDefaultImports": true,
"moduleResolution": "nodenext",
"moduleResolution": "NodeNext"
}
}
Loading