title: react js input checkbox toggle value
body: <p>Hear constructor of react js component</p>
  
  <pre><code>constructor(props) {
      super(props);
      this.state = {
          array : []
      }
      this.displayPageView = this.displayPageView.bind(this);
      this.onChange = this.onChange.bind(this);
  }
  </code></pre>
  
  <p>Hear on Chnage function when click on check box push that value in state array </p>
  
  <pre><code>onChange(e) {
      console.log("e.target.name &gt;&gt;",e.target.name)
      console.log("e.target.value &gt;&gt;",e.target.value);
      remove(this.state.array,{ [e.target.name] : !parseInt(e.target.value) })
      this.state.array.push({ [e.target.name] : !parseInt(e.target.value) });
      console.log("array &gt;&gt;",this.state.array)
      //this.setState({ [e.target.name] : e.target.value });
  }
  </code></pre>
  
  <p>Hear load check box view</p>
  
  <pre><code>displayPageView(){
      const id = parseInt(this.props.params.id);
      const memberships = find(this.props.currentPageData.data.memberships,{ id : id });
      const accessKey = JSON.parse(memberships.access_key);
      console.log("accessKey &gt;&gt;",accessKey);
      return map(accessKey, (value,key) =&gt;(
          &lt;div className="form-group col-sm-2" key={key}&gt;
              {ucfirst(key)}
              {
                  map(value, (value2,key2) =&gt;(
                      &lt;div className="checkbox" key={key+"_"+key2}&gt;
                          &lt;label key={key+"_"+key2}&gt;
                              &lt;input type='checkbox' key={key+"_"+key2} ref={value2} name={key+"_"+key2} value={value2} checked={(parseInt(value2)) ? true : false } onChange={this.onChange}&gt;&lt;/input&gt;
                              {(key2=='index') ? 'List' : ucfirst(key2)}
                          &lt;/label&gt;
                      &lt;/div&gt;
                  ))
              }
          &lt;/div&gt;
      ));
  }
  </code></pre>
  
  <p>When i click on check box push that name and value in array state object form and i also want to change check box checked value (true/false). </p>