Skip to content

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

Closed
@qaynam

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

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