Skip to content

typescript warning about @typescript-eslint/unbound-method for useIntl #4133

@Morriz

Description

@Morriz

Which package?

react-intl@6.2.10

Describe the bug

just using the useIntl hook produces the following warning:

Avoid referencing unbound methods which may cause unintentional scoping of `this`.
If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead.

To Reproduce

const { formatMessage } = useIntl()

Expected behavior

No warnings.

Screenshots

Screenshot 2023-06-19 at 10 45 22

Desktop (please complete the following information):

  • OS: OSX

Smartphone (please complete the following information):

Additional context

react-intl version: 6.2.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions