How to clear callbacks for HTML component?

Is there any way to clear callbacks for HTML component or forced it to rewrite?

Context of the problem:
The app has header, which is a HTML-component. On every view we set up ‘.on()’ for that component. The header depends on the parameters that this view was called with.
But now it turns out that when you first time enter the view, initialization occurs with some param and when you re-enter this view (but with different param), it shows the old header (with param from the first time) and it prints a message in the console:

Callback for ‘requestHeader’ is already registered for HTML component with ID header

You will have to re-initiate the HTML-component with the updated parameters by making sure that the view in question is not already on the view stack when you navigate to it.

When the view in question is resumed, the callback is already registered so it will not re-initialize with the updated parameters as expected. If the view in question is not on the view stack and you navigate to that view, then the HTML-component will reinitialize with the updated parameters as expected.

1 Like