Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create
usingPageElements
helper function (used in non-React c…
…ontexts)
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
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
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,12 @@ | ||
// Provides a way to check whether the `PageElementsProvider` React component was mounted or not, | ||
// in a non-React context. In React contexts, it's strongly recommended the value of `usePageElements` | ||
// React hook is checked instead (a `null` value means the provider React component wasn't mounted). | ||
let usingPageElementsFlag = false; | ||
|
||
export const usingPageElements = () => { | ||
return usingPageElementsFlag; | ||
}; | ||
|
||
export const setUsingPageElements = (value: boolean) => { | ||
usingPageElementsFlag = value; | ||
}; |