How can I set a a state variable to an object in react