There are plenty of questions about this topic already but I none I could see that both set the state then use that same state.
I am setting state on the first run an