Skip to content

Should useMessageGetter be memoized? #406

Description

@gamatatcu

The title says it all. Currently, every call of the useMessageGetter hook from @messageformat/react in the render of a component will return a new function which could lead to infinite rerender loops if you put it in the dependencies list of useEffect, etc.
This is more of a question/proposition since I don't have any experience in the development of such API: is it expected to have memoization on a hook like this one, or whether to memoize it or not lays in user space?

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