title: How can we remove an element dynamically in Reactjs
body: <p>I am creating a lot of elements dynamically. I have an array in state which keeps record of the elements. As I add more elements they concat with previous array elements. Here is the code.</p>
  
  <pre><code>var App = React.createClass({
    getInitialState: function() {
      return {
        propsList: []
        };
     },
    addProps: function(props) {
      var propsList = this.state.propsList.concat([props]);
        this.setState({ propsList: propsList });
          },
    render: function() {
      var components = this.state.propsList.map(function(props) {
        return React.createElement('g', props);
          });
      return React.createElement('div', null, components);
        }
    });
    ReactDOM.render(
        React.createElement(App, null),
        document.getElementById('svg')
      );
  </code></pre>
  
  <p>I want to remove an element(<code>g</code> tag) on which click action is performed. I have tried to use refs but it didn't worked as array is storing too many elements. </p>