UNPKG

@geekyhawks/react-native-ui-components

Version:

A lightweight and reusable React Native UI components library with customizable Text, TextInput, FloatingLabelTextInput, Button, and more. Built with TypeScript, fully typed, and designed for easy integration into any React Native project.

29 lines 1.17 kB
"use strict"; /** * CheckBoxContext * * Provides a React Context for managing checkbox groups. * - Stores the array of currently selected values. * - Exposes a callback to update the selected values. * - Used internally by `CheckBoxGroup` and consumed by individual `CheckBox` components * via the `useCheckBoxGroupContext` hook. * * Author: Geeky Hawks FZE LLC */ Object.defineProperty(exports, "__esModule", { value: true }); exports.useCheckBoxGroupContext = exports.CheckBoxGroupContext = void 0; const react_1 = require("react"); /** * React Context for managing checkbox group state. * Provides `selectedValues` and `onValueChange` to nested `CheckBox` components. */ exports.CheckBoxGroupContext = (0, react_1.createContext)(null); /** * Hook to access the current `CheckBoxGroupContext`. * Should only be used inside components wrapped by a `CheckBoxGroup`. * * @returns The current checkbox group context or `null` if not inside a group. */ const useCheckBoxGroupContext = () => (0, react_1.useContext)(exports.CheckBoxGroupContext); exports.useCheckBoxGroupContext = useCheckBoxGroupContext; //# sourceMappingURL=CheckBoxContext.js.map