Skip to content

[examples] Replace HOC pattern with render-props pattern #2983

@mattbrunetti

Description

@mattbrunetti
  • I have searched the issues of this repository and believe that this is not a duplicate.

Context

I initially found the HOC pattern to be confusing, since (as a consumer) you can't explicitly see what prop(s) are being added.

(Also, it seems weird to create a component that can't stand on it's own, and then wrap it into something that can.)

Here is an explanation of the render-props pattern, which solves that (first) problem to offer a better Developer eXperience:

https://cdb.reacttraining.com/use-a-render-prop-50de598f11ce

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