Skip to content

Typescript act() got warning 'await' has no effect on the type of this expression.#1276

Description

@qaynam

Describe the bug

when i use act with typescript , got warning like 馃憞

image

image

Steps to Reproduce

@testing-library/react-native/build/act.d.ts

declare global {
    var IS_REACT_ACT_ENVIRONMENT: boolean | undefined;
}
declare function setIsReactActEnvironment(isReactActEnvironment: boolean | undefined): void;
declare function getIsReactActEnvironment(): boolean | undefined;
- declare const act: (callback: () => void) => void;
+ declare const act: <T>(callback: () => T) => T;
export default act;
export { setIsReactActEnvironment as setReactActEnvironment, getIsReactActEnvironment, };

Versions

image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions