Question: Is there a solution to only change the template of a contentelement selected by typoscript?

Like this:

```
lib.testelement = CONTENT
lib.testelement {
    renderObj {
        file = Path/to/my/template.html
    }
    table = tt_content
    select {
        pidInList = MyPid
        where = uid=MyUid
        max = 1
    }
}

```

I need the assigned variables from the controller.

Answer: 
If you want to add/remove rows dynamically you can play with the state, or 
if you where using Redux you can play with the store.

Here's a simple example using a components local state to add and remove rows: 

<https://codesandbox.io/s/k302jwn44r>

EDIT: fixed mutating state

```
import React from "react";
import { render } from "react-dom";

const styles = {
  fontFamily: "sans-serif",
  textAlign: "left"
};

class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      rows: []
    };
  }

  handleAddRow = () => {
    this.setState((prevState, props) => {
      const row = {content: "hello this is a new row!" };
      return { rows: [...prevState.rows, row] };
    });
  };

  handleRemoveRow = () => {
    this.setState((prevState, props) => {
      return { rows: prevState.rows.slice(1) };
    });
  };

  render() {
    console.log(this.state);
    return (
      <div style={styles}>
        <table>
          <tbody>
            {this.state.rows.map(row => (
              <tr>
                <td>{row.content}</td>
              </tr>
            ))}
            <tr>
              <td className="" onClick={this.handleAddRow}>
                (+)
              </td>
              {Boolean(this.state.rows.length) && (
                <td onClick={this.handleRemoveRow}>(-)</td>
              )}
            </tr>
          </tbody>
        </table>
      </div>
    );
  }
}

render(<App />, document.getElementById("root"));

```
Thanks for the answer above.
Just a little bit comment on handling of 'handleChange'.
Do we need to change the following

```js
    rows[idx] = {
      [name]: value
    };
```

to the following for saving the data into rows:

```js
const rowInfo = rows[idx];
rowInfo[name] = value;
```