How to use the terra-breakpoints.withActiveBreakpoint function in terra-breakpoints

To help you get started, we’ve selected a few terra-breakpoints examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cerner / terra-core / packages / terra-breakpoints / src / terra-dev-site / doc / example / ActiveBreakpointProviderExample.jsx View on Github external
import React from 'react';
import { ActiveBreakpointProvider, withActiveBreakpoint, ActiveBreakpointContext } from 'terra-breakpoints';

const ActiveBreakpointConsumer1 = withActiveBreakpoint(({ activeBreakpoint }) => (
  <div>
    <p>This component uses the withActiveBreakpoint() component generator to interface with the ActiveBreakpointProvider.</p>
    <p>
      The active breakpoint is:
      {' '}
      {activeBreakpoint}
    </p>
  </div>
));

const ActiveBreakpointConsumer2 = () =&gt; (
  
    {
      activeBreakpoint =&gt; (
        <div>
          <p>This component interfaces with the ActiveBreakpointContext directly.</p></div>

terra-breakpoints

Contains components and utilities related to Terra's supported responsive breakpoints

Apache-2.0
Latest version published 5 months ago

Package Health Score

57 / 100
Full package analysis