Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Dec 4, 2018

This change adds support for React state/props access through the component methods: getSnapshotBeforeUpdate, shouldComponentUpdate and getDerivedStateFromProps. This is in response to https://discuss.lgtm.com/t/props-and-state-access-in-reacts-getderivedstatefromprops-method/1586 (Thanks @paulmelnikow).

(Evaluation in progress)

@paulmelnikow, your post does not contain a link to the false positive, can you link it here so I can check that we eliminate it?

@ghost ghost added the JS label Dec 4, 2018
@ghost ghost self-requested a review as a code owner December 4, 2018 10:04
asger-semmle
asger-semmle previously approved these changes Dec 4, 2018
Copy link
Contributor

@asger-semmle asger-semmle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ghost
Copy link
Author

ghost commented Dec 4, 2018

@paulmelnikow
Copy link

Thanks for picking this up!

Yea, it's badges/shields#2441.

@ghost
Copy link
Author

ghost commented Dec 4, 2018

I have verified that this fixes the FP in badges/shields#2441, and simplified the enclosing file to a regression test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants