@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.12 kB
JavaScript
/**
* RadioContext
*
* Provides a React Context for managing radio button groups.
* - Stores the currently selected value of the group.
* - Exposes a callback to update the selected value.
* - Used internally by `RadioGroup` and consumed by individual `Radio` components
* via the `useRadioGroupContext` hook.
*
* Author: Geeky Hawks FZE LLC
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.useRadioGroupContext = exports.RadioGroupContext = void 0;
const react_1 = require("react");
/**
* React Context for managing radio group state.
* Provides `selectedValue` and `onValueChange` to nested `Radio` components.
*/
exports.RadioGroupContext = (0, react_1.createContext)(null);
/**
* Hook to access the current `RadioGroupContext`.
* Should only be used inside components wrapped by a `RadioGroup`.
*
* @returns The current radio group context or `null` if not inside a group.
*/
const useRadioGroupContext = () => (0, react_1.useContext)(exports.RadioGroupContext);
exports.useRadioGroupContext = useRadioGroupContext;
//# sourceMappingURL=RadioContext.js.map
;