In 2016, a picture book titled “A Birthday Cake for George Washington” was withdrawn from stores after critics complained that it glossed over the horrors of slavery. A similar scandal engulfed the 2015 picture book “A Fine Dessert,” which depicted an enslaved mother and daughter hiding in a cupboard and cheerfully licking a bowl of batter clean; the author, Emily Jenkins, apologized and donated her earnings to We Need Diverse Books, a nonprofit that promotes diversity in children’s publishing. In 2017, Laura Moriarty’s dystopian novel, “American Heart,” was savaged, months before its release, by readers who said Ms. Moriarty had peddled a “white savior narrative” in her depiction of a future America where Muslims are placed in internment camps. Harlequin Teen delayed publication of Keira Drake’s fantasy novel, “The Continent,” after readers blasted it as “racist trash,” “retrograde” and “offensive.” Ms. Drake and her publisher, Harlequin Teen, apologized, and Ms. Drake rewrote the book, removing and revising some passages and character descriptions that readers had flagged as racially offensive.

Children’s book publishers have grown increasingly cautious when acquiring books that deal with charged subjects such as race, gender, sexuality and disability. Many publishers and authors now hire “sensitivity readers” who vet books and identify harmful stereotypes.

“When any author is writing outside their own experience, we want to make sure they’ve done their homework,” David Levithan, vice president and publisher of Scholastic Press, which regularly seeks advice from sensitivity readers, told The Times in 2017.

[Read about the growing trend of sensitivity readers.]

Edith Campbell, a reference librarian at Indiana State University who blogs about young adult literature, said readers’ ability to instantly weigh in on social media has forced publishers to confront the lack of diversity in the industry, and made it impossible for publishers and authors to ignore complaints when a book promulgates racial or other stereotypes.

“This is one of the few ways that publishing has evolved into the 21st century, by having to listen to people’s immediate reaction to what they’re publishing,” she said.

Shelley Diaz, a former reviews manager and young adult editor at School Library Journal, said “Blood Heir” and other young adult fantasy novels that deal with slavery often deserve extra scrutiny from readers because the stories are crafted for an impressionable young audience, and praised Ms. Zhao for responding to critics.

“Some people in the community have found things that were worthy of critique and weren’t handled in a culturally competent way,” she said. “A lot of authors have been confronted with critiques like these and decided to stand their ground and not change anything, but this was a woman of color who was brave enough to say, ‘I hear you, I hear this critique, and I want to bring a better book out to my readers.’”