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
@d3x7r0 it's an oversight, but I think if we want to add support for updating when the listing changes we'll need to deeply compare the object values within props.components:
- shouldComponentUpdate({ wrap, type, markup }) { + shouldComponentUpdate({ wrap, type, markup, components }) {
let p = this.props;
+ if (Object.keys(components).join()!=Object.keys(p.components).join()) return true;+ for (let i in Object(components)) if (components[i]!==p.components[i]) return true;
return wrap!==p.wrap || type!==p.type || markup!==p.markup;
}
That looks like it might be a good enough solution yes. I'm also going to steal that key comparison for my toolset. I never thought of doing it that way but it's such a great idea I'm going to keep it handy :)
When using the option to add a map of custom elements the component will not update if said mapping changes.
I think the problem might be here:
preact-markup/src/index.js
Lines 11 to 14 in 034c4c6
Now I don't know if this is intended behaviour or just a oversight.
The text was updated successfully, but these errors were encountered: