Search code examples
reactjsoptimizationweb-worker

Handle slow rendering complex components


I have very slow rendering components in my project, which makes the routing very slow. Similar issue happens for the input field on entering the text as i have complex logic for the validation. How can i handle it in an efficient way.

For better understanding of the issue, sharing a codesandbox link.

Thanks for all the help


Solution

  • I fixed the performance issue using web workers, for that I used one wrapper library for web worker, @koale/useworker.

    Here is the codesandbox link