Skip to content

Conversation

@s0
Copy link
Contributor

@s0 s0 commented Dec 11, 2018

I know that this is just in example code, but given that these are the only two alerts remaining for this project on LGTM, I thought it's probably worth the PR :)

React component state updates using setState may asynchronously update this.props and this.state, thus it is not safe to use either of the two when calculating the new state passed to setState, and instead the callback-based variant should be used instead. (details here).

These were found on LGTM.com, and other than the alert fixed in #230, there are no remaining alerts.

(Full disclosure: I'm part of the team behind LGTM.com)

React component state updates using setState may
asynchronously update this.props and this.state, thus it is
not safe to use either of the two when calculating the new
state passed to setState, and instead the callback-based
variant should be used instead.
@ant-design-bot
Copy link

Deploy preview for rc-menu failed.

Built with commit e48ab83

https://app.netlify.com/sites/rc-menu/deploys/5c0f14100097d42028d347fc

@afc163 afc163 merged commit 7e19257 into react-component:master Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants