React Js Check If Variable Is Undefined