getInitialState()

in transforms/__testfixtures__/class/class-initial-state.input.js [129:154]


  getInitialState() {
    if (this.props.stuff) {
      return {x: 1};
    } else if (this.props.thing) {
      return {x: 2};
    }
    switch (this.props.wow) {
      case 1:
        return this.props.lol ?
          {x: 3} :
          this.whatever(this.props);
    }
    for (let i = 0; i < 100; i++) {
      if (i === 20) {
        return {x: i};
      }
    }

    try {
      doSomeThingReallyBad();
    } catch (e) {
      return {error: e};
    }

    return this.lol();
  },