Disc–corona interaction in the heartbeat state of GRS 1915+105