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
- We can change a part of the render replacing the lit html template enter image description here
- The data for the component can have lit templates to be used in the operation enter image description here
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?