mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
don't render until we have a GET value
This commit is contained in:
@@ -9,6 +9,7 @@ import * as FeaturesApi from 'api/features';
|
|||||||
const FeaturesLoader: FC<RequiredChildrenProps> = (props) => {
|
const FeaturesLoader: FC<RequiredChildrenProps> = (props) => {
|
||||||
const { data: features } = useRequest(FeaturesApi.readFeatures);
|
const { data: features } = useRequest(FeaturesApi.readFeatures);
|
||||||
|
|
||||||
|
if (features) {
|
||||||
return (
|
return (
|
||||||
<FeaturesContext.Provider
|
<FeaturesContext.Provider
|
||||||
value={{
|
value={{
|
||||||
@@ -18,6 +19,7 @@ const FeaturesLoader: FC<RequiredChildrenProps> = (props) => {
|
|||||||
{props.children}
|
{props.children}
|
||||||
</FeaturesContext.Provider>
|
</FeaturesContext.Provider>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default FeaturesLoader;
|
export default FeaturesLoader;
|
||||||
|
|||||||
Reference in New Issue
Block a user