0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

View file

@ -0,0 +1,8 @@
import React from 'react';
const ThemeContext = React.createContext(null);
if (process.env.NODE_ENV !== 'production') {
ThemeContext.displayName = 'ThemeContext';
}
export default ThemeContext;

View file

@ -0,0 +1 @@
export { default } from './useTheme';

View file

@ -0,0 +1,12 @@
import 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;
}