Today we know that a lot of the ideas about evolution presented in early science fiction novels and short stories were based on wrong assumptions. Which is not surprising, considering that even scientists did not fully understand the concept. For a time there was a mutationism movement, that believed it was mutations alone, not natural selection, that was responsible for evolution. Gradually more knowledge was accumulated, and in 1953 the first description of the DNA molecule was published. But of course, you don't have to know all about molecular genetics and similar disciplines to understand the basic principles of evolution if you're an author of science fiction. And yet, even with the present day knowledge, we often see a lot of scientific nonsense regarding evolution in science fiction related topics even today. For instance the X-Men, Star Trek (which otherwise often deal with interesting scientific ideas), Jurassic Park and Mohinder's voice over monologues in the beginning of each episode of the TV-show heroes. Obviously not something we are not meant to take seriously, but it does give an incorrect image of what evolution is.
So when did the first examples of evolution done right in a way that even PZ Myers would approve it start to appear in the world of science fiction?
(Some science fiction authors discuss biology, but doesn't answer the question: https://media.nature.com/full/nature-assets/nature/journal/v448/n7149/extref/448018a-s1.pdf )