We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b75970c commit d116ffeCopy full SHA for d116ffe
src/components/3d/NetworkVisualization.tsx
@@ -322,9 +322,7 @@ function GridFloor() {
322
function BackgroundStars() {
323
const theme = useNetworkStore(state => state.ui.theme);
324
325
- if (theme !== 'dark') return null;
326
-
327
- // Use useMemo to generate consistent star positions
+ // Use useMemo to generate consistent star positions (must be called before any early returns)
328
const stars = useMemo(() => {
329
return Array.from({ length: 100 }).map((_, i) => ({
330
position: [
@@ -337,6 +335,8 @@ function BackgroundStars() {
337
335
}));
338
336
}, []);
339
+ if (theme !== 'dark') return null;
+
340
return (
341
<>
342
{stars.map((star, i) => (
0 commit comments