Skip to content
This repository was archived by the owner on Sep 10, 2022. It is now read-only.
This repository was archived by the owner on Sep 10, 2022. It is now read-only.

Pass state and props as arguments to lifecycle methods #500

@maxhallinan

Description

@maxhallinan

One thing I like about recompose is that it enables me to create complex stateful components out of functions that don't depend on context. Two examples are withState and withStateHandlers. state and stateUpdater are passed as props instead of bound to this. This is nice because I can write more generic functions that consume these values. The same is not true for lifecycle. The handlers passed to lifecycle are given to their respective hooks without any context abstraction. So for these handlers, I either have to write that wrapper myself or write functions tied to this. Is there any interest in updating lifecycle to pass the context into the handler like withState and withStateHandlers?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions