Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type 'void | Destructor' is not assignable to type 'void | (() => void | undefined)'. #2

Open
ptmkenny opened this issue Feb 27, 2021 · 0 comments

Comments

@ptmkenny
Copy link

Thanks for providing this hook.

Unfortunately, after updating to @ionic/[email protected] and @types/[email protected], I'm now getting the following error:

TypeScript error in /home/me/d/ionic/src/utils/useNonInitialEffectHook.tsx(29,7):
Type 'void | Destructor' is not assignable to type 'void | (() => void | undefined)'.
  Type 'Destructor' is not assignable to type 'void | (() => void | undefined)'.
    Type 'Destructor' is not assignable to type '() => void | undefined'.
      Type 'void | { [UNDEFINED_VOID_ONLY]: never; }' is not assignable to type 'void | undefined'.
        Type '{ [UNDEFINED_VOID_ONLY]: never; }' is not assignable to type 'void'.  TS2322

    27 |       initialRender.current = false;
    28 |     } else {
  > 29 |       effectReturns = effect();
       |       ^
    30 |     }
    31 | 
    32 |     if (effectReturns && typeof effectReturns === 'function') {


[ERROR] An error occurred while running subprocess react-scripts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant