|
|
@@ -1,25 +1,22 @@
|
|
|
-import { useTheme, useLocalStorageThemeName } from './index.js';
|
|
|
-import { useEffect } from 'react';
|
|
|
+import { useTheme, useLocalStorageThemeName } from "./index.js";
|
|
|
+import { useEffect } from "react";
|
|
|
|
|
|
export default (props) => {
|
|
|
- const { setThemeName } = props
|
|
|
+ const { setThemeName } = props;
|
|
|
const [] = useTheme();
|
|
|
// const [themeName] = useThemeKey()
|
|
|
- const [themeNameInLC] = useLocalStorageThemeName()
|
|
|
+ const [themeNameInLC] = useLocalStorageThemeName();
|
|
|
|
|
|
// useEffect(() => {
|
|
|
// setThemeName(themeName)
|
|
|
// }, [themeName])
|
|
|
|
|
|
useEffect(() => {
|
|
|
- setThemeName(themeNameInLC)
|
|
|
- }, [themeNameInLC])
|
|
|
- console.log(11,props)
|
|
|
- if(props.children){
|
|
|
+ setThemeName(themeNameInLC);
|
|
|
+ }, [themeNameInLC]);
|
|
|
+ if (props.children) {
|
|
|
return props.children;
|
|
|
- }else{
|
|
|
- return (
|
|
|
- <>加载中...</>
|
|
|
- );
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
}
|
|
|
};
|