Late last year, the novelist Keira Drake announced that her publisher was giving away copies of her upcoming young adult novel, “The Continent,” a fantasy set in a world where two nations have been at war for centuries. “It’s raining books!” she wrote.

Her enthusiasm was quickly punctured. Online reviews poured in, and they were brutal. Readers pounced on what they saw as racially charged language in the descriptions of the warring tribes and blasted it as “racist trash,” “retrograde” and “offensive.” Ms. Drake and her publisher, Harlequin Teen, apologized and delayed the book’s publication.

In the year since, “The Continent” has changed drastically. Harlequin hired two sensitivity readers, who vetted the narrative for harmful stereotypes and suggested changes. Ms. Drake spent six months rewriting the book, discarding descriptions like her characterization of one tribe as having reddish-brown skin and painted faces. The new version is due out in March.

In today’s hair-trigger, hyperreactive social media landscape, where a tweet can set off a cascade of outrage and prompt calls for a book’s cancellation, children’s book authors and publishers are taking precautions to identify potential pitfalls in a novel’s premise or execution. Many are turning to sensitivity readers, who provide feedback on issues like race, religion, gender, sexuality, chronic illness and physical disabilities. The role that readers play in shaping children’s books has become a flash point in a fractious debate about diversity, cultural appropriation and representation, with some arguing that the reliance on sensitivity readers amounts to censorship.