Skip to content

Standard mixin substitute for ES6 classes #5010

@marnusw

Description

@marnusw

The well used react-onclickoutside mixin for detecting mouse clicks outside a React Component cannot be used with ES6 classes. I have proposed a wrapper function/higher-order component/decorator in a PR at Pomax/react-onclickoutside#22.

The author @Pomax has asked me to check in and find out whether this aligns with what might become the official approach to realizing mixin-like functionality for ES6 classes before he merges it?

It seems to be becoming a de facto standard with a couple of larger libraries following this approach including Yahoo's Fluxible in connectToStores() and Material UI in ThemeDecorator(). The Relay syntax also appears to be similar?

The intended use is documented with the changes in the PR mentioned above.

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