mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-28 12:36:35 +00:00
Avoid rerender cascade
Previously a `js_trigger` event in MMD3's resting state would take about 40ms to render. Now it takes about 4ms.
This commit is contained in:
parent
ed8409b644
commit
eb815d2ed1
1 changed files with 2 additions and 2 deletions
|
|
@ -613,7 +613,7 @@ function XmlChildren({ node }) {
|
|||
}
|
||||
|
||||
// Given a skin XML node, pick which component to use, and render it.
|
||||
function XmlNode({ node }) {
|
||||
const XmlNode = React.memo(({ node }) => {
|
||||
let { name } = node;
|
||||
if (name == null) {
|
||||
// name is null is likely a comment
|
||||
|
|
@ -634,7 +634,7 @@ function XmlNode({ node }) {
|
|||
useJsUpdates(node);
|
||||
const Component = NODE_NAME_TO_COMPONENT[name] || DummyComponent;
|
||||
return <Component node={node} {...node.attributes} />;
|
||||
}
|
||||
});
|
||||
|
||||
function getSkinUrlFromQueryParams() {
|
||||
const searchParams = new URLSearchParams(window.location.search);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue