In 2017, Roald Dahl's widow told the BBC in an interview, that Charlie Bucket had been a black child in an early draft and that Roald Dahl's agent had persuaded him to change Charlie's skin colour.
So I think it’s neat that in this midcentury moment Dahl has this black boy get stuck inside a mold that fits him perfectly — he emphasizes that — everything about the mold fits Charlie, except once the chocolate inside the mold hardens, it’s uncomfortable! So what better symbol of what it’s like to be turned into a racial stereotype than a black boy who gets stuck inside a life-size chocolate mold and can’t be seen or heard through this chocolate coating.
(...) “Charlie and the Chocolate Factory” is published in the U.S. in 1964, amid the Civil Rights movement in the U.S. and race riots in England. Dahl should have been aware that the “happy slave” was not a permissible stereotype. And yet in the original edition Oompa Loompas were a tribe of African pygmies. I think this arc — from what I find to be a fairly antiracist novel to the novel that has been rightly criticized for its racist and imperialist politics — what it really shows is Dahl’s ambivalence. I think we’re in the right cultural moment to understand that. Like Claudia Rankine has said, we need to understand how white people imagine race. And so I think it’s really telling that Dahl seems to identify with this vulnerable character. I mean, he himself was the son of Norwegian immigrants, and was bullied at British boarding schools. I think Dahl always felt like an outsider who was bullied into Britishness.
(...) I think that’s the power of racism — to make someone able to hold these contradictory views at once. To both identify with the underdog and seem to understand the pain of stereotype, but then be completely flummoxed that anyone finds the Oompa Loompas offensive. He was genuinely surprised and very annoyed. So I don’t mean for this to whitewash Dahl’s racial politics. I just really love the vulnerability and the potential in this first draft.
(...) That’s the other thing about this book — it ends up being about the virtuous white factory boy. Isn’t that where we’ve ended up now, as a society? We hear so much about the virtuous white workers, and it often seems to be taking black people out of the story. Charlie and the Oompa Loompas are very similar, both starving. All the other children are bad consumers because they eat without pleasure. So it’s really interesting to think about the book’s trajectory — Charlie becomes white, and he ultimately ascends in the Great Glass Elevator, the best metaphor for white privilege I’ve ever seen! And all the Oompa Loompas are back in the factory serving Wonka.