We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba9081f commit 420c9f7Copy full SHA for 420c9f7
packages/react/src/provider/use-context-mutator.ts
@@ -1,4 +1,4 @@
1
-import { useContext } from 'react';
+import { useCallback, useContext, useRef } from 'react';
2
import { OpenFeature, EvaluationContext } from '@openfeature/web-sdk';
3
import { Context } from './context';
4
@@ -9,7 +9,7 @@ import { Context } from './context';
9
*/
10
export function useContextMutator() {
11
const { domain } = useContext(Context) || {};
12
- const previousContext = useRef(null);
+ const previousContext = useRef<null | EvaluationContext>(null);
13
14
const mutateContext = useCallback(async (updatedContext: EvaluationContext) => {
15
if (previousContext.current !== updatedContext) {
0 commit comments