mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
fix: move useUiFlag before "return null" to avoid rendering more hooks on the first render (#5258)
Move the hook to before the first return to avoid React erroring out.
This commit is contained in:
parent
fe61947435
commit
7cf998c509
@ -86,12 +86,12 @@ export const ChangeRequestOverview: FC = () => {
|
||||
const { isChangeRequestConfiguredForReview } =
|
||||
useChangeRequestsEnabled(projectId);
|
||||
|
||||
const scheduleChangeRequests = useUiFlag('scheduledConfigurationChanges');
|
||||
|
||||
if (!changeRequest) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const scheduleChangeRequests = useUiFlag('scheduledConfigurationChanges');
|
||||
|
||||
const allowChangeRequestActions = isChangeRequestConfiguredForReview(
|
||||
changeRequest.environment,
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user