Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack Size Exceeded during shouldComponentUpdate #368

Closed
wants to merge 2 commits into from

Conversation

tanhauhau
Copy link

Similar to redux-form/redux-form#3461,
and as per mentioned reactjs/react.dev#7

I'm suggesting a safer deep equal comparison on the props to be generated.

@CLAassistant
Copy link

CLAassistant commented Apr 13, 2018

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Apr 13, 2018

Codecov Report

Merging #368 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #368      +/-   ##
==========================================
+ Coverage    97.6%   97.61%   +0.01%     
==========================================
  Files           3        3              
  Lines         292      294       +2     
==========================================
+ Hits          285      287       +2     
  Misses          7        7
Impacted Files Coverage Δ
src/Helmet.js 100% <100%> (ø) ⬆️
src/HelmetUtils.js 96.91% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c102586...3a54657. Read the comment docs.

@laooola
Copy link

laooola commented Jul 9, 2018

we encountered the same issue in one of our projects - waiting for this PR to be merged 👍

@StevenLangbroek
Copy link

Is there intent to merge this? PR has been open for a while, if this won't be merged we'll consider forking or switching to react-helmet-async.

@laooola
Copy link

laooola commented Sep 25, 2018

@StevenLangbroek We were able to circumvent this issue by defining a shouldComponentUpdate lifecycle method in the parent component that deeply compares the props with the nextProps.

import React from 'react'
import Helmet from 'react-helmet'
import isEqual from 'lodash.isequal'

export class MyComponent extends React.Component {
  shouldComponentUpdate(nextProps) {
    return !isEqual(this.props, nextProps)
  }

  render() {
    return (
      <Helmet>
        <title>MyTitle</title>
		...
      </Helmet>
    )
  }
}

@StevenLangbroek
Copy link

@laooola hey! while i appreciate that, we have a temporary fix in place. reason I ask is because we'd like to have some idea when we can retire what is essentially a hack around a bug. hope you understand.

thanks ✌️

@nathancahill
Copy link

We have this issue with out project too when using Immutable.js, getting stack size exceeded errors with deep-equal

@tmbtech tmbtech added this to In progress in React-Helmet Dec 7, 2018
@tmbtech
Copy link
Contributor

tmbtech commented Dec 7, 2018

Fix in #402

@tmbtech tmbtech closed this Dec 7, 2018
React-Helmet automation moved this from In progress to Done Dec 7, 2018
@tmbtech
Copy link
Contributor

tmbtech commented Dec 7, 2018

Thank you for your PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
React-Helmet
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

7 participants