Skip to content

Commit

Permalink
fix rerender problem when changing something in the content block (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelblum authored Feb 8, 2024
1 parent ebcc444 commit 6e4ceb4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/admin/src/emailCampaigns/form/EmailCampaignForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
useSaveState,
} from "@comet/cms-admin";
import { IconButton } from "@mui/material";
import React from "react";
import React, { useMemo } from "react";
import { FormattedMessage } from "react-intl";
import { useRouteMatch } from "react-router";

Expand Down Expand Up @@ -79,7 +79,7 @@ export function EmailCampaignForm({ id, EmailCampaignContentBlock, scope, previe
const blockContext = useCmsBlockContext();
const match = useRouteMatch();

const FinalFormEmailCampaignContentBlock = createFinalFormBlock(EmailCampaignContentBlock);
const FinalFormEmailCampaignContentBlock = useMemo(() => createFinalFormBlock(EmailCampaignContentBlock), [EmailCampaignContentBlock]);

const { data, error, loading, refetch } = useQuery<GQLEmailCampaignFormQuery, GQLEmailCampaignFormQueryVariables>(
emailCampaignFormQuery,
Expand Down

0 comments on commit 6e4ceb4

Please sign in to comment.