Skip to content

Commit

Permalink
[C] wrap review widgets in error boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgoff committed Apr 30, 2024
1 parent bc1a4a4 commit c4b2e9d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/questions/Review/Widget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import * as Styled from "../styles";
import { WidgetInput } from "@/types/answers";
import { BaseReviewProps } from "@/types/questions";
import useAnswer from "@/hooks/useAnswer";
import ErrorBoundary from "@/components/atomic/ErrorBoundary";

export interface WidgetReviewWrapperProps extends BaseReviewProps {
id: string;
Expand Down Expand Up @@ -49,7 +50,9 @@ const WidgetReviewWrapper: FunctionComponent<WidgetReviewWrapperProps> = ({
<Styled.ReviewListItem value={number}>
<QuestionLabel dangerouslySetInnerHTML={{ __html: instructions }} />
<Styled.PrintWrapper>
<Widget data={widgetConfig} value={answer} {...{ id }} />
<ErrorBoundary>
<Widget data={widgetConfig} value={answer} {...{ id }} />
</ErrorBoundary>
</Styled.PrintWrapper>
</Styled.ReviewListItem>
);
Expand Down

0 comments on commit c4b2e9d

Please sign in to comment.