JK Rowling has said people who criticise the casting of a black actress as Hermione in the new Harry Potter stage play are “a bunch of racists”.

Noma Dumezweni will star as the character from JK’s books – who was played by Emma Watson in the films – in Harry Potter And The Cursed Child in the West End.

The author told The Observer that the decision has been criticised by some social media users.

“With my experience of social media, I thought that idiots were going to idiot,” she said.

Read more: JK Rowling shortlisted for crime novel prize with Robert Galbraith Book

“But what can you say? That’s the way the world is.

“Noma was chosen because she was the best actress for the job.”

JK RowlingJK Rowling (Ian West/PA)

JK went on: “I had a bunch of racists telling me that because Hermione ‘turned white’ – that is, lost colour 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.”

Based on an original story by JK, the play is set 19 years after the events of Harry Potter And The Deathly Hallows.

Read more: JK Rowling involved in 'freedom of speech' Twitter spat with SNP MP

It will focus on Harry – now an “overworked employee of the Ministry of Magic, a husband and father of three school-age children” – and his middle child, Albus Severus.

Jamie Parker will play an adult Harry Potter, while Paul Thornley will play Ron Weasley.

The show officially opens at the Palace Theatre London in July, with preview performances from June 7.