@rolster/react-components 18.26.15 → 18.26.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/es/index.js CHANGED
@@ -3831,14 +3831,16 @@ function useSnackbar() {
3831
3831
  visible: false
3832
3832
  });
3833
3833
  const onClose = useCallback(() => {
3834
+ timeoutId.current && clearTimeout(timeoutId.current);
3835
+ timeoutId.current = undefined;
3834
3836
  setState((state) => ({ ...state, visible: false }));
3835
3837
  }, []);
3836
3838
  const rlsSnackbar = (jsxRuntimeExports.jsx(RlsSnackbar, { ...state.config, visible: state.visible, onClose: onClose }));
3837
3839
  useEffect(() => {
3838
3840
  if (state.visible) {
3839
3841
  timeoutId.current = setTimeout(() => {
3840
- setState((state) => ({ ...state, visible: false }));
3841
3842
  timeoutId.current = undefined;
3843
+ setState((state) => ({ ...state, visible: false }));
3842
3844
  }, duration.current);
3843
3845
  }
3844
3846
  else if (timeoutId.current) {