Skip to content

Instantly share code, notes, and snippets.

View ghardin137's full-sized avatar

Greg Hardin ghardin137

View GitHub Profile
@bpas247
bpas247 / state-updates-are-async.md
Last active March 17, 2023 17:12
State Updates Are Asynchronous

State Updates Are Asynchronous

The gist of it

You do this.

const handleEvent = e => {
  setState(e.target.value);
  console.log(state);
}