Skip to content

Commit

Permalink
fix: remove repeat effect hook to resolve mix up (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tzyito authored Nov 2, 2024
1 parent cb8354d commit 5159aec
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,20 +210,6 @@ const Toast = (props: ToastProps) => {
isDocumentHidden,
]);

React.useEffect(() => {
const toastNode = toastRef.current;

if (toastNode) {
const height = toastNode.getBoundingClientRect().height;

// Add toast height tot heights array after the toast is mounted
setInitialHeight(height);
setHeights((h) => [{ toastId: toast.id, height, position: toast.position }, ...h]);

return () => setHeights((h) => h.filter((height) => height.toastId !== toast.id));
}
}, [setHeights, toast.id]);

React.useEffect(() => {
if (toast.delete) {
deleteToast();
Expand Down

0 comments on commit 5159aec

Please sign in to comment.