From 4d8be8679b38c5b42d3ae943be60828f1d065937 Mon Sep 17 00:00:00 2001 From: Anthony Raymond Date: Sat, 21 Aug 2021 22:35:35 +0200 Subject: [PATCH] [alpha] Add .bind(this) to method stored in provider state (#397) --- src/SnackbarProvider.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SnackbarProvider.tsx b/src/SnackbarProvider.tsx index 5a6a9cad..a0c7f230 100644 --- a/src/SnackbarProvider.tsx +++ b/src/SnackbarProvider.tsx @@ -31,8 +31,8 @@ class SnackbarProvider extends Component { snacks: [], queue: [], // eslint-disable-line react/no-unused-state contextValue: { - enqueueSnackbar: this.enqueueSnackbar, - closeSnackbar: this.closeSnackbar, + enqueueSnackbar: this.enqueueSnackbar.bind(this), + closeSnackbar: this.closeSnackbar.bind(this), }, }; }