Skip to content

Commit

Permalink
Merge pull request #2143 from navikt/video-rerender-error
Browse files Browse the repository at this point in the history
Add key to macromapper, to ensure rerenders work on correct component
  • Loading branch information
talepre authored Jan 9, 2025
2 parents 85f9c60 + a90ae9a commit 56d78dd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/_common/parsedHtml/ParsedHtml.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ export const ParsedHtml = ({ htmlProps }: Props) => {

// Handle macros
if (tag === processedHtmlMacroTag) {
return <MacroMapper macros={macros} macroRef={attribs?.['data-macro-ref']} />;
return (
<MacroMapper
key={attribs?.['data-macro-ref']}
macros={macros}
macroRef={attribs?.['data-macro-ref']}
/>
);
}

// Remove img without src
Expand Down

0 comments on commit 56d78dd

Please sign in to comment.