Avoid theme not ready causing the select to not render (#7194)
release.yml / release (push) Canceled after 0s

This commit is contained in:
Hariom Balhara authored and GitHub committed 2023-02-18 15:53:14 +00:00
1 parent 3c7fc85b34
commit d7b4d5932d
1 file changed
+4 -4
+4 -4
View File
@@ -29,7 +29,7 @@ function Select<
IsMulti extends boolean = false,
Group extends GroupBase<Option> = GroupBase<Option>
>({ className, ...props }: SelectProps<Option, IsMulti, Group>) {
const { resolvedTheme, forcedTheme, isReady } = useTheme();
const { resolvedTheme, forcedTheme /*isReady*/ } = useTheme();
const hasDarkTheme = !forcedTheme && resolvedTheme === "dark";
const darkThemeColors = {
/** Dark Theme starts */
@@ -74,9 +74,9 @@ function Select<
};
// Till we know in JS the theme is ready, we can't render react-select as it would render with light theme instead
if (!isReady) {
return <input type="text" className={className} />;
}
// if (!isReady) {
// return <input type="text" className={className} />;
// }
return (
<ReactSelect
theme={(theme) => ({