Closed mkbctrl closed 2 years ago
Hey, I wanted to ask what do you think about converting the:
declare type ToastType = 'success' | 'error' | 'loading' | 'blank' | 'custom'; declare type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
into enums?
That way we can use the enum in a code like:
import { ToastPosition } from 'react-hot-toast'; /** * @description default configuration for all toast notifications **/ export const defaultToastOptions = { position: ToastPosition.BottomLeft, reverseOrder: false, gutter: 10, containerStyle: { bottom: 100, left: 20 }, toastOptions: { duration: 2000 }, }
which seems more type safe. I am happy to create PR, if you like this idea.
Hi! In this case I prefer the string constants for a few reasons:
Why do feel like this would be more type safe?
Hey, I wanted to ask what do you think about converting the:
into enums?
That way we can use the enum in a code like:
which seems more type safe. I am happy to create PR, if you like this idea.