And next in the firing line are those who taken to Twitter to complain about the casting of a black actress to play the role of Hermione Granger in the upcoming play Harry Potter and the Cursed Child.

Speaking to The Observer about the trolls, Rowling called them "a bunch of racists", and added, "With my experience of social media, I thought that idiots were going to idiot. But what can you say? That’s the way the world is."

Emma Watson played Hermione Granger in the Harry Potter films

The casting of British actress Noma Dumezweni in the role of Hermione was announced last December, with most fans reacting positively to the news that the Olivier award-wining actress would be reprising the role famously played by Emma Watson in the original film franchise. The play is set in the years after the main characters have left Hogwarts, although no other details about the plot have been revealed.

"Noma was chosen because she was the best actress for the job," Rowling said.

“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," she continued.

"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.”

Noma Dumezweni as Hermione with Ron Weasley and their child, Rose

The Harry Potter books don't explicitly mention Hermione's race or skin colour, and this is the first time a leading character will be played by a person of colour.

"What shocked me was the way people couldn’t visualise a non-white person as the hero of a story," he said. "It’s therefore brilliant that this has happened.”

JK Rowling at the world premiere of Harry Potter and the Deathly Hallows: Part 2 in London

The script for Harry Potter and the Cursed Child was written by Jack Thorne, although Rowling also contributed ideas. The hotly-anticipated play has already broken records by selling some 175,000 tickets in just 24 hours.

With a new Potter book being released at the end of July, the author divulged that Harry Potter is still very much a part of her life. "It was 17 years, and just because I’ve stopped on the page doesn’t mean my imagination stopped," she said.

“It’s like running a very long race. You can’t just stop dead at the finishing line."

Harry Potter and the Cursed Child will open in the West End next month.