There is a genetic predisposition in people who get type 1 diabetes
However, it isn't enough. Exposure to an environmental trigger(s) is necessary to cause diabetes. The trigger(s) isn't known. Even in identical twins, if one get diabetes, the other only has a 40% chance of getting it.