react syntex highlighter preformence

I am using the react syntex highlighter library and it works great, the problem starts in formating string over 8000 lines of json,
it takes too long and it freeze the app, I am trying to find for a useful way to make it faster and that it will not freeze the app.

  • I’ve tried to implement infinite scroll with the react syntex highlighter library and it didn’t went well beacuse they don’t support that kind of functionality and try and to make it custom for my usage didn’t went well also.
  • It come to my mind to maybe use web worker but I’ve tought it might be an overkill for this and it won’t be usefull in some use cases.