From 7380d0f6506ebb93dd9d6ca4d506325c7146bcb3 Mon Sep 17 00:00:00 2001 From: William Grant Date: Fri, 14 Oct 2022 14:21:35 +1100 Subject: [PATCH] fix: pr review - move WrappedToastContainer outside of SessionToastContainerPrivate to prevent rerendering --- ts/components/SessionToastContainer.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ts/components/SessionToastContainer.tsx b/ts/components/SessionToastContainer.tsx index 33205c161..260f787de 100644 --- a/ts/components/SessionToastContainer.tsx +++ b/ts/components/SessionToastContainer.tsx @@ -2,16 +2,16 @@ import React from 'react'; import { Slide, ToastContainer, ToastContainerProps } from 'react-toastify'; import styled from 'styled-components'; -const SessionToastContainerPrivate = () => { - const WrappedToastContainer = ({ - className, - ...rest - }: ToastContainerProps & { className?: string }) => ( -
- -
- ); +const WrappedToastContainer = ({ + className, + ...rest +}: ToastContainerProps & { className?: string }) => ( +
+ +
+); +const SessionToastContainerPrivate = () => { return (