Thanks for creating awesome library. This has really saved my time.
I want to bring to your notice that the wrapped React component is getting rendered multiple times initially. To be exact it re-renders as many times as many attributes listening on.
Here is the code snippet which reproduces this issue:
Thanks for creating awesome library. This has really saved my time.
I want to bring to your notice that the wrapped React component is getting rendered multiple times initially. To be exact it re-renders as many times as many attributes listening on.
Here is the code snippet which reproduces this issue:
Above component is used as below
I managed to debug the code and my observation is
attributeChangedCallback
rendering the react component again https://github.com/ChristophP/web-react-components/blob/master/src/index.js#L206. InitiallyattributeChangedCallback
is called for every attribute then finallyconnectedCallback
is called.We can add condition in
attributeChangedCallback
to re-render only onceconnectedCallback
has been called. Something like this