mercredi 29 janvier 2020

How to make components rendered via helper independent

I have few instances of component (let's call it <Row />) with given template:

    

I' calling <Row /> component from <Terminal /> component like this:


  <Row @result= @confirm= @resultComponentName=/>

<Terminal /> component has property:

@tracked resultComponentName;

which is handled in action:

    if (cmd.resultComponentName) {
      this.resultComponentName = cmd.resultComponentName;
    } else {
      this.resultComponentName = 'result-component';
    }

now I want to change @resultComponentName in only one instance but when I am changing @resultComponentName all of the component <Row /> instances re-render.

How can I prevent that behavior and make every instance independent? Thanks in advance!




Aucun commentaire:

Enregistrer un commentaire