Avoid theme not ready causing the select to not render (#7194)

7198-cal-1112-wrong-link-in-enterprise-upgrade-screen v2.6.2
Hariom Balhara 2023-02-18 21:23:14 +05:30 committed by GitHub
parent 3c7fc85b34
commit d7b4d5932d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

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) => ({