DEV Community

Discussion on: Creating React components without this. #nothis

Collapse
 
josefjelinek profile image
Josef Jelinek • Edited

Unfortunately, this code is not idiomatic as you should pass a function to the setState in this case or else from several increments in a row most get ignored as the state is updated asynchronously and they will have a stale state... nothis FTW is what I take feom this comment in the end...