Author JK Rowling has described people who criticised the casting of a black actress as Hermione in the new Harry Potter play as "a bunch of racists".
The Harry Potter creator told The Observer that she had "a great deal of difficulty with" their insistence that the character "must be a white woman".
Olivier winner Noma Dumezweni "was the best actress for the job," she went on.
Harry Potter and the Cursed Child begins previewing at London's Palace Theatre on Tuesday.
The two-part production, written by Jack Thorne, is eagerly anticipated and expected to be one of the year's biggest stage successes.
Rowling said her "experience of social media" had led to her to expect "idiots were going to idiot" [sic] about Dumezweni's casting.
"But what can you say? That's the way the world is," she continued, adding she had "decided not to get too agitated" about the reaction online.
Instead, she said, she had decided to "simply state quite firmly that Hermione can be a black woman with my absolute blessing and enthusiasm."
In the same Observer article, director John Tiffany is quoted as saying he was "shocked [that] people couldn't visualise a non-white person as the hero of a story".
When Dumezweni's casting was announced last year, the author said Hermione's ethnicity was "never specified" and that she "loved" having the character played by a non-white actress.
Emma Watson played the character in the eight Harry Potter films made between 2001 and 2011.
The two-part Harry Potter and the Cursed Child is the eighth story in the series and the first official story of the franchise to be presented on stage.
The plot sees Harry Potter as a husband and father of three school-age children, with a job working for the Ministry of Magic.
Rowling said she was "hopeful" that further story details would remain unrevealed ahead of the plays' official opening on 30 July.
"I hope we get there without any major spoilers, purely because people will have an amazing experience if they don't know what's coming."
Ticket holders have been asked to arrive early at performances due to the tight security procedures that will be in place.