Skip to content

Commit

Permalink
fix(eslint): ignore react-compiler/react-compiler
Browse files Browse the repository at this point in the history
- `CustomSelect` жалуется на `renderOption` в 729 строке, что якобы идёт обращение к `ref.current`, но такого там нет;
    ```plain
    729:51  error  Ref values (the `current` property) may not be accessed during render. (https://react.dev/reference/react/useRef)  react-compiler/react-compiler
    ```
- `ModalRootContext` и `useModalManager` переписываются в PR #6759.
  • Loading branch information
inomdzhon committed Nov 5, 2024
1 parent fa08668 commit eca463e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/vkui/src/components/CustomSelect/CustomSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ export function CustomSelect<OptionInterfaceT extends CustomSelectOptionInterfac
const resolvedContent = React.useMemo(() => {
const defaultDropdownContent =
options.length > 0 ? (
// eslint-disable-next-line react-compiler/react-compiler
<div ref={optionsWrapperRef}>{options.map(renderOption)}</div>
) : (
<Footnote className={styles.empty}>{emptyText}</Footnote>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export function useModalRegistry(
return undefined;
}, []);

// eslint-disable-next-line react-compiler/react-compiler
const refs = React.useRef<Required<ModalRefs>>({
modalElement: (e) => (elements.modalElement = e),
innerElement: (e) => (elements.innerElement = e),
Expand Down
1 change: 1 addition & 0 deletions packages/vkui/src/components/ModalRoot/useModalManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export function useModalManager(
initModal: (state: ModalsStateEntry) => void = noop,
): ModalTransitionProps {
const modalsState = React.useRef<ModalsState>({}).current;
// eslint-disable-next-line react-compiler/react-compiler
getModals(children).forEach((Modal) => {
const modalProps = Modal.props;
const id = getNavId(modalProps, warn);
Expand Down

0 comments on commit eca463e

Please sign in to comment.