chore(build): try to build demo and docs (#3434)
This commit is contained in:
1 parent
869b8ced05
commit
828690cd3b
329 files changed
+1896
-1010
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import React, { useState, createContext, useContext } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const appConfigContext = createContext(null);
|
||||
const { Provider } = appConfigContext;
|
||||
|
||||
export const useAppConfig = () => useContext(appConfigContext);
|
||||
|
||||
export function AppConfigProvider({ children, value: initAppConfig }) {
|
||||
const [appConfig, setAppConfig] = useState(initAppConfig);
|
||||
|
||||
return <Provider value={[appConfig]}>{children}</Provider>;
|
||||
}
|
||||
|
||||
AppConfigProvider.propTypes = {
|
||||
children: PropTypes.any,
|
||||
value: PropTypes.any,
|
||||
};
|
||||
|
||||
export default AppConfigProvider;
|
||||
@@ -0,0 +1,3 @@
|
||||
import { AppConfigProvider, useAppConfig } from './appConfig.tsx';
|
||||
|
||||
export { AppConfigProvider, useAppConfig };
|
||||
Reference in new issue
Block a user