digitransit-ui/digitransit-component/packages/digitransit-component-with-breakpoint
2025-05-21 18:37:05 +03:00
..
src fix: manually fix some lint errors 2020-09-17 14:16:36 +03:00
LICENSE-AGPL.txt feat: add with-breakpoint 2020-04-23 16:41:04 +03:00
LICENSE-EUPL.txt feat: add with-breakpoint 2020-04-23 16:41:04 +03:00
package.json chore: update i18next to latest versionb which works without esm6 2025-05-21 18:37:05 +03:00
README.md docs: update readme 2020-04-27 16:18:20 +03:00
test.js fix: import path 2020-08-21 10:10:15 +03:00

@digitransit-component/digitransit-component-with-breakpoint

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 Whether any ref given to the HOC should be forwarded to the extended Component. (optional, default {forwardRef:false})
    • forwardRef.forwardRef

This module is part of the Digitransit-ui project. It is maintained in the HSLdevcom/digitransit-ui repository, where you can create PRs and issues.

Installation

Install this module individually:

$ npm install @digitransit-component/digitransit-component-with-breakpoint

Or install the digitransit-component module that includes it as a class:

$ npm install @digitransit-component/digitransit-component