Relay.Storeis a globally available instance of singleton Relay.Environmentand Relay.Store.commitUpdate()updates data in this global environment. But since you are using your own instance Relay.Environment, you need to use it to update it this.props.relay.commitUpdate(), as you noted. This updates the environment in which the container was processed.
, Relay.Container, . relay prop, :
<Child relay={this.props.relay} />
, Relay, Relay. , , :
onCreateProfile = () => {
this.props.relay.commitUpdate(new CreateProfile());
};
render:
<Child onCreateProfile={this.onCreateProfile} />
, Relay.Container , Relay.Environment ( , , ).