Use React components inside lit elements perfromance

72 Views Asked by At

In our project we use lit for web components creation and we use lit wrappers https://lit.dev/docs/frameworks/react/ for use them in a React application.

In some of our components we indicate features that can be used in the apps

The idea is that in React that parts need to be also React component becuase we consider React developers no need to know about lit. For that we created a operation to 'convert' the react to the lit template enter image description here enter image description here

How you can see we use createRoot and root render for the operation

This works good in general case but there is a issue with performance. Lit lifecycle finish before than react render and sometimes this cause a issue and other times the issue can be showed visually.

The curious is that if we use react test utils act or old ReactDom.render it works better but with error messages.

There is any wat to lit lifycle wait the react render to continue? or sothing similar to the act that we can use?

0

There are 0 best solutions below