Skip to content

infinite loop with setState( { dirty...} #39

@tcoldmf

Description

@tcoldmf

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.

{snip} .getElementHeight(this.wrapper);t===this.state.height?this.setState({dirty:!1}):this.setState({height:t,dirty:!1},function(){return e.props. {snip}

Code:

        <ReactHeight onHeightReady={ height => setHiddenContent( height > props.maxHeight )}>
          {
            hidden_content &&
              <div
                style={{
                    top: '120px',
                    height: '80px',
                    width: '100%',
                    position: 'absolute',
                    backgroundImage: 'url(/assets/images/mensajero/degradado.png)',
                }}
              />
          }
          { props.children.contentToCollapse }
        </ReactHeight>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions