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

HOC for use with non hook components #49

Open
@RedHatter

Description

@RedHatter

Having a code base that has both hook based and class based components is common. It would be useful for react-atom to provide a HOC for these components. Something simple like the following should work.

const connect = (mapStateToProps, store) => Component => props => {
  const stateProps = mapStateToProps(useAtom(store))
  return <Component {...stateProps} {...props} />
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions