Centralize route generation to a single place
This commit is contained in:
1 parent
eecdb62dda
commit
a99badd011
15 files changed
+57
-34
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import { useCallback, useState } from 'react';
|
||||
|
||||
/**
|
||||
* Implements the state/methods defined in `appConfig.context`.
|
||||
*/
|
||||
export const useAppConfig = initialValue => {
|
||||
const [config, setConfig] = useState(initialValue || {});
|
||||
|
||||
const setCurrentConfig = useCallback(updatedConfig => {
|
||||
setConfig(updatedConfig);
|
||||
}, []);
|
||||
|
||||
return {
|
||||
config,
|
||||
setCurrentConfig,
|
||||
};
|
||||
};
|
||||
Reference in new issue
Block a user