You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: flavors/swagger-ui-react/index.jsx
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,7 @@ const SwaggerUI = ({
93
93
})
94
94
95
95
setSystem(systemInstance)
96
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- intentionally mount-only: creates the initial SwaggerUI system instance once; prop changes after mount are handled by the dedicated effects below
96
97
},[])
97
98
98
99
useEffect(()=>{
@@ -106,6 +107,7 @@ const SwaggerUI = ({
106
107
}
107
108
}
108
109
}
110
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- prevUrl is intentionally excluded: it is a usePrevious ref value and adding it would cause the effect to double-fire when the URL changes
109
111
},[system,url])
110
112
111
113
useEffect(()=>{
@@ -121,6 +123,7 @@ const SwaggerUI = ({
121
123
system.specActions.updateSpec(updatedSpec)
122
124
}
123
125
}
126
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- prevSpec is intentionally excluded: it is a usePrevious ref value and adding it would cause the effect to double-fire when the spec changes
0 commit comments