digitransit-ui/digitransit-component/packages/digitransit-component-with-breakpoint/README.md
2020-04-27 16:18:20 +03:00

44 lines
1.5 KiB
Markdown

# @digitransit-component/digitransit-component-with-breakpoint
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## BreakpointConsumer
Extracts breakpoint information (can be one of: large, medium and small) from the context.
## withBreakpoint
Extends the given Component with breakpoint handling. The breakpoint is
extracted from context and given to the extended component as a property.
### Parameters
- `Component` **any** The component to extend with breakpoint handling
- `forwardRef` **[boolean][1]** Whether any ref given to the HOC should be forwarded to the extended Component. (optional, default `{forwardRef:false}`)
- `forwardRef.forwardRef`
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the digitransit-component project. -->
---
This module is part of the Digitransit-ui project. It is maintained in the
[HSLdevcom/digitransit-ui](https://github.com/HSLdevcom/digitransit-ui) repository, where you can create
PRs and issues.
### Installation
Install this module individually:
```sh
$ npm install @digitransit-component/digitransit-component-with-breakpoint
```
Or install the digitransit-component module that includes it as a class:
```sh
$ npm install @digitransit-component/digitransit-component
```