FrontendChallenges is a collection of frontend interview questions and answers. It is designed to help you prepare for frontend interviews. It's free and open source.
But the problem is with the above code is that because of slow component re-rendering, the dialog takes more than 1 second to open. How can we optimize this?
Info
Question
Imagine a site that has a slow component.
Now you are required to add a Button that opens a dialog. For that you added button and dialog and a state to manage the dialog.
But the problem is with the above code is that because of slow component re-rendering, the dialog takes more than 1 second to open. How can we optimize this?
Template
App.jsx
SlowComponent.jsx