The struggles of Mary's pregnancies did not directly impact the writing of "Frankenstein" by giving her the idea for the novel. The novel was inspired by a dream she had. Her experiences during her pregnancies might have influenced her work indirectly by shaping her views on birth and creation.
Mary Shelley's personal struggles during her pregnancies and the loss of her children might have influenced her writing in a way that highlights the themes of birth and creation in "Frankenstein." The novel explores the consequences of playing god-like roles in creation and the destructive potential of scientific advancements.
While Mary's pregnancies did not give her the idea for "Frankenstein," they could have contributed to the deeper themes present in the novel, such as the power and responsibility that come with creation, as well as the potential destructive outcomes that may result from playing with forces beyond human control.