You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn't a big issue and more like an optimisation, where we could only append to the stylesheet the current classNames being used.
We could introduce Stylesheet.collect to analyse the html as a string, and compare the classnames.
Making sure the "critical" is the required to be appended to the resultant HTML.
let stylesheet = Stylesheet.get_all();
let html = ReactDOMServer.renderToString(<App />);
let (critical, other) = Stylesheet.collect(html, css);
The API might change, but the solution should look quite similar
The text was updated successfully, but these errors were encountered:
davesnx
changed the title
Server-side apis get all stylesheet at once
Server-side apis get all stylesheet at once (maybe it should only get the "current")
Oct 22, 2024
This isn't a big issue and more like an optimisation, where we could only append to the stylesheet the current classNames being used.
We could introduce
Stylesheet.collect
to analyse the html as a string, and compare the classnames.Making sure the "critical" is the required to be appended to the resultant HTML.
Taken from: https://github.com/callstack/linaria/blob/master/docs/API.md#collecthtml-string-css-string--string
The API might change, but the solution should look quite similar
The text was updated successfully, but these errors were encountered: