3.4.0 • Published 2 years ago

@procore/labs-distribution-select v3.4.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
github
Last release
2 years ago

Distribution Select Introduction

Installation

yarn add @procore/labs-distribution-select

Dependencies

@procore/core-react and react are listed as external peer dependencies. The package will not bundle the code, and requires the app client to provide it as a dependency. The external peer dep is to assure React Context is consistent in a client's React tree, the child consumers can reference the correct parent provider. If the package uses latest features or bug fixes and a new minimum version of core-react is required, it should be considered a breaking change as the peer dependency version must be met.

Usage

import {
  DistributionSelect,
  DistributionSelectProvider,
  DistributionContact,
} from '@procore/labs-distribution-select';

export const Demo = () => {
  const [value, setValue] = useState<DistributionContact[]>([])
  return (
    <DistributionSelectProvider
      projectId={1}
      companyId={2}
    >
      <DistributionSelect
        value={value}
        onChange={(v) => setValue(v)}
        variant="project" // or "company" or "mixed"
      />
    </DistributionSelectProvider>
  )
}

DistributionSelectProvider is responsible for making API calls and storing fetched data. There must be at least one provider in application component tree.

3.4.0

2 years ago

3.3.0

2 years ago

3.0.3

2 years ago

3.2.0

2 years ago

3.1.0

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

3 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.0

4 years ago