Skip to content

defaultVisible #150

@Staskasnz

Description

@Staskasnz

Hello, I can’t seem to pass the "true" value in defaultVisible to a created and registered modal window, how can I do this correctly?
Typescript suggests exactly this method, but no matter how hard I try, I can’t pass the defaultVisible value

const DesktopMenu = loadable(
  () => import('src/entities/menu').then((mod) => mod.DesktopMenu),
  {
    ssr: false,
  }
);

const DesktopMenuWithProps = NiceModal.create(DesktopMenu);

const registar = () => {
  NiceModal.register('desktop-menu', DesktopMenuWithProps, {
    defaultVisible: true,
  });
};

export const ModalProvider: React.FC = ({ children }) => {
  registar();
  return <NiceModal.Provider>{children}</NiceModal.Provider>;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions