UNPKG

@audira/carbon-react-native

Version:

Build React Native apps with component and shared patterns using Carbon

19 lines (18 loc) 676 B
"use strict"; import { useWindowDimensions } from 'react-native'; import { BreakpointContext } from "../../../contexts/breakpoint/index.js"; import { BreakpointHelper } from "../../../helpers/index.js"; import { BreakpointGlobal } from "../../globals/index.js"; import { jsx as _jsx } from "react/jsx-runtime"; export function BreakpointProvider({ children }) { const windowDimensions = useWindowDimensions(), breakpoint = BreakpointHelper.getToken(windowDimensions.width); BreakpointGlobal.set(breakpoint); return /*#__PURE__*/_jsx(BreakpointContext.Provider, { value: breakpoint, children: children }); } //# sourceMappingURL=BreakpointProvider.js.map