Harry Potter and the Cursed Child announced its cast back in December, and everyone (er, at least non-terrible people) seemed thrilled to find out about black actress Noma Dumezweni playing Hermione. Especially since J.K. Rowling herself is the first to admit that Hermione was never explicitly written as white in the Harry Potter series.
Of course, some corners of the internet weren't thrilled that a white actress wasn't cast, and those corners of the internet are racist. We know this because a) there's literally no other explanation for being bummed about a black actress playing Hermione, and b) J.K. Rowling says so.
In an recent interview, the author said "I had a bunch of racists telling me that because Hermione 'turned white'—that is, lost color from her face after a shock—that she must be a white woman, which I have a great deal of difficulty with. But I decided not to get too agitated about it and simply state quite firmly that Hermione can be a black woman with my absolute blessing and enthusiasm."
First of all, even if Hermione was explicitly written as white, there's no reason the role can't be given to a black actress. Second of all, the only other time Hermione's skin color is described in the Harry Potter book series indicates that she's a woman of color. See?
"They were there, both of them, sitting outside Florean Fortescue's Ice Cream Parlor—Ron looking incredibly freckly, Hermione very brown, both waving frantically at him."
No further comment necessary.