score:2

Accepted answer

if the default value for bgimage needs to be determined before app is rendered, then usually you would do this by passing a prop into the component e.g.

<app bgimage={`url(${logo1})`} />

then in the constructor, you can set this as the default state

class app extends component {
  constructor(props) {
    super(props);
    this.state = {
      bgimage: props.bgimage
    };
  }
}

Related Query

More Query from same tag