Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CARE-5168] Fix Video not working after switching languages #82

Merged

Conversation

e1himself
Copy link
Contributor

No description provided.

Copy link
Contributor

@fgyimah fgyimah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +40 to +49
const MemoHtml = memo(
forwardRef(
(
{ html, ...restProps }: HTMLAttributes<HTMLDivElement> & { html: string },
ref: ForwardedRef<HTMLDivElement>,
) => <div ref={ref} {...restProps} dangerouslySetInnerHTML={{ __html: html }} />,
),
);

MemoHtml.displayName = 'MemoHtml';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've used memo() here to avoid re-rendering and erasing the modified div innerHTML content.

@e1himself e1himself merged commit 9b45c8d into master May 28, 2024
9 checks passed
@e1himself e1himself deleted the fix/care-5168-video-not-working-after-swirtrching-language branch May 28, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants