if json is not empty

    0

    0

    majid ghasemi

    The code is checking to see if the retJson object has any key-value pairs. If it does not, the state of the app is set to {isEditing:false} and the app returns. If the retJson object does have key-value pairs, the code retrieves the first key from the Object.keys(retJson) list and sets the state of the app to {thatKey:value}; then it returns.

    if (Object.keys(retJson).length == 0) {
        this.setState(
        {
        //isEditing: false
        }
        );
        return;
      }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.