question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting warning: “Re-rendered because the state object itself changed but it’s values are all equal.” “This usually means this component called setState when no changes in it’s state actually occurred.” “more info at http://bit.ly/wdyr02” prev state: Object {} !== Object {} :next state

I added a console log of the props, and it can be seen that its only rendering once per prop change.

The component:

class MyComp extends PureComponent {
    static whyDidYouRender = true;

    render() {
        console.log('rerendered', this.props.downloadProgress);
        return (
            <View/>
        );
    }
}

const mapStateToProps = state => ({
    downloadProgress: getDownloadProgress(state),
});

export default connect(mapStateToProps)(MyComp);

Every time the prop changes causing a rerender I get the warning above that the warning is unnecessary, which is false.

It may also be worth noting that this component is opened/hosted via react-navigation.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:10

github_iconTop GitHub Comments

1reaction
vzaidmancommented, May 24, 2019

@parties I dont have it here where I updated react-redux and redux: https://codesandbox.io/s/whydidyourender-false-positive-demo-pjkn7

These older versions didn’t handle state changes as well as the last version. I strongly suggest using the last one.

0reactions
dihancommented, Dec 11, 2019

Updating Redux fixed this issue for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

False positives and false negatives - Wikipedia
These are the two kinds of errors in a binary test, in contrast to the two kinds of correct result (a true positive...
Read more >
False Positive (2021) - IMDb
False Positive : Directed by John Lee. With Ilana Glazer, Justin Theroux, Gretchen Mol, Sabina Gadecki. As if getting pregnant weren't complicated enough, ......
Read more >
False Positive - Rotten Tomatoes
Hindle (Pierce Brosnan). But after becoming pregnant with a healthy baby girl, Lucy begins to notice something sinister through Hindle's gleaming charm, and...
Read more >
Definition of false-positive test result - National Cancer Institute
false -positive test result ... A test result that indicates that a person has a specific disease or condition when the person actually...
Read more >
Watch False Positive Streaming Online | Hulu (Free Trial)
Alone Deep Water The Evil Next Door The Owners Fear of Rain Girl Held Shortcut The Free Fall Every Breath You Take Run....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found