From 0d170e811e145eb270b8ef8337c67f2732e601f6 Mon Sep 17 00:00:00 2001 From: Aleix Suau Date: Wed, 22 Apr 2026 14:42:48 +0200 Subject: [PATCH] IS-10847 Replace useContext with use hook in HaapiStepperFormContext. --- .../feature/actions/form/HaapiStepperFormContext.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/login-web-app/src/haapi-stepper/feature/actions/form/HaapiStepperFormContext.ts b/src/login-web-app/src/haapi-stepper/feature/actions/form/HaapiStepperFormContext.ts index a0e152e0..651f643f 100644 --- a/src/login-web-app/src/haapi-stepper/feature/actions/form/HaapiStepperFormContext.ts +++ b/src/login-web-app/src/haapi-stepper/feature/actions/form/HaapiStepperFormContext.ts @@ -9,8 +9,7 @@ * For further information, please contact Curity AB. */ -// eslint-disable-next-line @eslint-react/no-use-context -import { createContext, useContext } from 'react'; +import { createContext, use } from 'react'; import { HaapiStepperFormAction, HaapiStepperFormState } from '../../stepper/haapi-stepper.types'; @@ -23,8 +22,7 @@ export interface HaapiStepperFormContextValue { export const HaapiStepperFormContext = createContext(null); export function useHaapiStepperForm(): HaapiStepperFormContextValue { - // eslint-disable-next-line @eslint-react/no-use-context -- useContext is preferred here over use() to keep explicit null handling - const context = useContext(HaapiStepperFormContext); + const context = use(HaapiStepperFormContext); if (!context) { throw new Error('useHaapiStepperForm must be used within a .'); }