-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert contexts to
jsx
for now to avoid breaking storybook
- Loading branch information
1 parent
94b91f8
commit e489b1f
Showing
3 changed files
with
29 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { useContext, createContext } from 'react'; | ||
|
||
// TODO: | ||
// I tried converting this to a .tsx file, but it made storybook fail; created HMP-250 to track this | ||
// We should continue specifying shapes of contexts as we start using them in our TS files | ||
const FlaskDataContext = createContext({}); | ||
|
||
/** | ||
* @typedef AppContextType | ||
* @property {string} assetsEndpoint | ||
* @property {string} groupsToken | ||
*/ | ||
|
||
/** | ||
* @type {AppContextType} | ||
*/ | ||
const AppContext = createContext({}); | ||
|
||
FlaskDataContext.displayName = 'FlaskDataContext'; | ||
|
||
export { FlaskDataContext, AppContext }; | ||
export const useAppContext = () => useContext(AppContext); | ||
export const useFlaskDataContext = () => useContext(FlaskDataContext); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters