coreui / coreui-pro

Other
8 stars 10 forks source link

Type Error in useColorModes Function #553

Open beejuice-fr opened 2 weeks ago

beejuice-fr commented 2 weeks ago

Description: There is a type mismatch in the useColorModes function. The interface for setColorMode is defined as:

interface UseColorModesOutput {
  colorMode: string | undefined;
  isColorModeSet: () => boolean;
  setColorMode: Dispatch<SetStateAction<string>>;
}

However, the correct type should allow setColorMode to handle both string and undefined values. The interface should be updated as follows:

interface UseColorModesOutput {
  colorMode: string | undefined
  isColorModeSet: () => boolean
  setColorMode: Dispatch<SetStateAction<string | undefined>>
}