Avoid theme not ready causing the select to not render (#7194)
parent
3c7fc85b34
commit
d7b4d5932d
|
@ -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) => ({
|
||||
|
|
Loading…
Reference in New Issue