Skip to content

Commit

Permalink
CustomSelectControl: Refactor and revert code changes made in #67733
Browse files Browse the repository at this point in the history
  • Loading branch information
yogeshbhutkar committed Dec 11, 2024
1 parent 2ec0a2e commit 39ac45a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/components/src/custom-select-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ function CustomSelectControl< T extends CustomSelectOption >(
defaultValue: options[ 0 ]?.name,
} );

const { value: currentValue } = Ariakit.useStoreState( store );

const children = options
.map( applyOptionDeprecations )
.map( ( { name, key, hint, style, className } ) => {
Expand Down Expand Up @@ -151,10 +149,12 @@ function CustomSelectControl< T extends CustomSelectOption >(
);
} );

const { value: currentValue } = Ariakit.useStoreState( store );

const renderSelectedValueHint = () => {
const selectedOptionHint = options
?.map( applyOptionDeprecations )
?.find( ( { name } ) => store.getState().value === name )?.hint;
?.find( ( { name } ) => currentValue === name )?.hint;

return (
<Styled.SelectedExperimentalHintWrapper>
Expand Down

0 comments on commit 39ac45a

Please sign in to comment.