Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 = () => (
{
activeBreakpoint => (
<div>
<p>This component interfaces with the ActiveBreakpointContext directly.</p></div>