I\'m trying to set state n React with a function that gives me the expected result when using debugger while it changes the whole prop when ran normally
debug