react-lift-props
TypeScript icon, indicating that this package has built-in type declarations

1.6.0 • Public • Published

react-lift-props · Version CircleCI Codecov

This library solves a problem that occurs when you try to do composition with systems of components. For example, while before you might have this:

<Stepper>
  <Step name="my step name" />
</Stepper>

Now you can do this:

const MyCoolStep = () => {
  return <Step name="my step name" />
}

...

<Stepper>
  <MyCoolStep />
</Stepper>

This let's you encapsulate properties of the sub components so that the parent component doesn't need to know about it's details. It also let's you re-use components, group components, and all the other benefits of composition. For a more in-depth explanation of why this library exists, check out the medium post.

Docs

  • Check out the usage docs here

Limitations

  • Does not work in React Native
  • Does not work with non-index keys
    • Use indexes as keys on lifters and use non-index keys when looping over liftedProps

Roadmap

Contributing

  • fork / clone
  • run npm install && npm run setup
  • open a PR

/react-lift-props/

    Package Sidebar

    Install

    npm i react-lift-props

    Weekly Downloads

    0

    Version

    1.6.0

    License

    MIT

    Unpacked Size

    21.6 kB

    Total Files

    13

    Last publish

    Collaborators

    • benlorantfy