@kobionic/react-compose
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

React-Compose

Build status npm version License Code style

A simple React component used to combine multiple components.

Installation

npm install @kobionic/react-compose

Why?

const App = () => {
  return (
    <AProvider>
      <BProvider>
        <CProvider>
          <DProvider>
            <EProvider>
              <MyPage />
            </AProvider>
          </BProvider>
        </CProvider>
      </DProvider>
    </EProvider>
  );
};

Tired of this? Ok that can lead to nice art, but that's not really the point...

Usage

const App = () => {
  return (
    <Compose components={[AProvider, BProvider, CProvider, DProvider, EProvider]}>
      <MyPage />
    </Compose>
  );
};

Passing props

const App = () => {
  return (
    <Compose components={[AProvider, { component: BProvider, props: bProviderProps }, CProvider, DProvider, EProvider]}>
      <MyPage />
    </Compose>
  );
};

Authors

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i @kobionic/react-compose

    Weekly Downloads

    1

    Version

    1.0.2

    License

    Apache-2.0

    Unpacked Size

    9.44 kB

    Total Files

    9

    Last publish

    Collaborators

    • jeremiergz