Check out example codes for "Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.". It will help you in understanding the concepts better.

Code Example 1

import React, { Component } from 'react';
import styled from 'styled-components';

class Item extends React.Component {
    constructor(props) {
        this.toggle= this.toggle.bind(this);
        this.state = {
            details: false
        const currentState = this.state.details;
        this.setState({ details: !currentState }); 

    render() {
        return (
            <tr className="Item"> 
                <td className={this.state.details ? "visible" : "hidden"}>PLACEHOLDER MORE INFO</td>
                {<td><span onClick={this.toggle()}>Details</span></td>}

export default Item;

Code Example 2

when handle event,change this.toggle() to this.toggle or {()=> this.toggle()}

Learn ReactJs, React Native from