Blame view

天文台pc/tianwentai-ui/node_modules/@mui/private-theming/esm/useTheme/useTheme.js 521 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
  'use client';
  
  import * as React from 'react';
  import ThemeContext from "./ThemeContext.js";
  export default function useTheme() {
    const theme = React.useContext(ThemeContext);
    if (process.env.NODE_ENV !== 'production') {
      // TODO: uncomment once we enable eslint-plugin-react-compiler eslint-disable-next-line react-compiler/react-compiler
      // eslint-disable-next-line react-hooks/rules-of-hooks -- It's not required to run React.useDebugValue in production
      React.useDebugValue(theme);
    }
    return theme;
  }