0

Is there a way to delay rendering of content of dropdown/modal until it is open?

I see they are being rendered even if they are not visible until user clicks to see its contents.

eugene
  • 33,301
  • 47
  • 188
  • 382

1 Answers1

1

The Modal component uses Portal for rendering content, while Portal renders something only if it's open. This means that the component already satisfies your conditions.

With the Dropdown component, it will be more difficult. You can control it yourself, but it means that you will need to process all events self-consciously and it will be not easy.

<Dropdown open={true} options={open && options} />
Oleksandr Fediashov
  • 3,967
  • 1
  • 20
  • 40