When he was eleven years old, his native region of Prekmurje was incorporated into the Kingdom of Serbs, Croats and Slovenes and thus into Slovenia.
In the 1930s, he started writing his first short stories, following the emerging trend of social realism.
In 1941, just prior to the Axis invasion of Yugoslavia, Kranjec became a member of the Yugoslav Communist Party.
During World War II he collaborated with the Liberation Front of the Slovenian People.
[2] After the Communist takeover in 1945, he held several positions in the regime's cultural policy.