pre-installations and preparations
This commit is contained in:
1 parent
3e5a0329cb
commit
201d621ac3
6977 files changed
+742826
No files matched your search
+6
@@ -0,0 +1,6 @@
|
||||
import * as React from 'react';
|
||||
const ThemeContext = /*#__PURE__*/React.createContext(null);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
ThemeContext.displayName = 'ThemeContext';
|
||||
}
|
||||
export default ThemeContext;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export { default } from './useTheme';
|
||||
export * from './useTheme';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './useTheme';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/useTheme/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import { DefaultTheme } from '../defaultTheme';
|
||||
|
||||
export default function useTheme<T = DefaultTheme>(): T;
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import * as React from 'react';
|
||||
import ThemeContext from './ThemeContext';
|
||||
export default function useTheme() {
|
||||
const theme = React.useContext(ThemeContext);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
React.useDebugValue(theme);
|
||||
}
|
||||
return theme;
|
||||
}
|
||||
Reference in new issue
Block a user