Skip to content

Commit

Permalink
[usePicker]: remove returning context from hook
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekseyManetov committed Feb 24, 2025
1 parent 526fcb5 commit 13c1f81
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion uui-components/src/pickers/hooks/usePicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ export function usePicker<TItem, TId>(
};

return {
context,
dataSourceState,
getName,
getPluralName,
Expand Down
7 changes: 4 additions & 3 deletions uui-components/src/pickers/hooks/usePickerInput.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useMemo, useEffect, useCallback } from 'react';
import React, { useMemo, useEffect, useCallback, useContext } from 'react';
import { Modifier } from 'react-popper';
import {
DataRowProps, isMobile, mobilePopperModifier, Lens, PickerFooterProps, DataSourceState,
DataRowProps, isMobile, mobilePopperModifier, Lens, PickerFooterProps, DataSourceState, UuiContext,
} from '@epam/uui-core';
import { PickerTogglerProps } from '../PickerToggler';
import { PickerBodyBaseProps } from '../PickerBodyBase';
Expand All @@ -15,6 +15,8 @@ import { UsePickerInputProps } from './types';
const initialRowsVisible = 20; /* estimated, with some reserve to allow start scrolling without fetching more data */

export function usePickerInput<TItem, TId, TProps>(props: UsePickerInputProps<TItem, TId, TProps>) {
const context = useContext(UuiContext);

const popperModifiers: Modifier<any>[] = useMemo(() => [
{
name: 'offset',
Expand Down Expand Up @@ -58,7 +60,6 @@ export function usePickerInput<TItem, TId, TProps>(props: UsePickerInputProps<TI

const picker = usePicker<TItem, TId>({ ...props, showSelectedOnly }, pickerInputState);
const {
context,
view,
handleDataSourceValueChange,
getEntityName,
Expand Down
2 changes: 0 additions & 2 deletions uui-components/src/pickers/hooks/usePickerModal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export function usePickerModal<TItem, TId>(props: UsePickerModalProps<TItem, TId
pickerListState,
);
const {
context,
view,
getEntityName,
getName,
Expand Down Expand Up @@ -75,7 +74,6 @@ export function usePickerModal<TItem, TId>(props: UsePickerModalProps<TItem, TId
};

return {
context,
selection,
dataSourceState,
dataSourceStateLens,
Expand Down

0 comments on commit 13c1f81

Please sign in to comment.