You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using this code to validate if some hook is used inside an specific context but I obtain the following error: ESLint: Unnecessary conditional, value is always falsy.(@typescript-eslint/no-unnecessary-condition), what is the correct way to handle this, disabling the rule or is there another way?
importReactfrom'react'import{AppStateContext}from'../components/containers'exportfunctionuseAppState(){constcontext=React.useContext(AppStateContext)if(!context){// error comes from herethrownewError('useAppState must be used within the AppStateProvider')}returncontext}
The text was updated successfully, but these errors were encountered:
I'm using this code to validate if some hook is used inside an specific context but I obtain the following error:
ESLint: Unnecessary conditional, value is always falsy.(@typescript-eslint/no-unnecessary-condition)
, what is the correct way to handle this, disabling the rule or is there another way?The text was updated successfully, but these errors were encountered: