If a spaceship landed in northern Texas and beamed every adolescent within a 50-mile radius into its desolate interior, the scene would look a lot like what now lies in front of me. It’s difficult to believe there are any teenagers in north Texas not currently forming orderly queues at the Las Colinas conference centre – a formidably angular set of slabs in the Texan wasteland.

Yet among the lines of young readers at the North Texas Teen Book Festival, their arms cradling impractical numbers of books, and the row of authors signing on an industrial scale, one woman stands out. Angie Thomas, one of the youngest writers in the place, is one black face in a sea of white. She’s upbeat, her hair tied with a perky bow, and when a fan says she looks “so pretty” in a top that combines a hood with sheer lace panels, she laughs and says “thank you” in a Mississippi accent whose vowels are so many notes, it’s a beguiling song. She fingers the garment. “My friend called it Thug Life with a feminine twist.”

However you interpret that description, it will mean something different after reading Thomas’s book, the recently released The Hate U Give. She’s a 29-year-old woman from Jackson who has written a novel that is a strident and utterly compelling march into the most sensitive and contentious subjects in America today: race, privilege and the killings of unarmed black people at the hands of the police. And she has done so for the young adult fiction scene – the popular “YA” genre still best known for Harry Potter and the Twilight trilogy. Among these overwhelmingly white adolescents in suburban Texas, the book has completely sold out and will, a few days later, debut at number one on the New York Times bestseller list. It’s a publishing miracle.

The Hate U Give tells the story of Starr, a 16-year-old black girl who lives in inner-city America in a neighbourhood that is poor and black, but goes to school in a suburb that is affluent and white. At home, Starr’s loving and protective parents usher their children into a room they call the “den” not just to watch basketball games, but to shield them from the machine gun fire that frequently erupts on the street outside. One night Starr and her childhood friend Khalil are driving home from a party when they are pulled over by police. Khalil, who is unarmed, is made to get out of the vehicle, and an officer – who later claims he mistook the boy’s hairbrush for a gun –shoots and kills him, traumatising Starr.

It’s a story based in many ways on Thomas’s own childhood, growing up poor in the predominantly black Georgetown neighbourhood of Jackson, Mississippi. “When I was six, I was at the park, and two drug dealers decided to recreate the wild west with a shootout,” Thomas recalls. “I ended up running out of the crossfire, and, the very next day, my mom took me to the library, because she wanted me to see that there was more to the world than what I saw that day.”

Making a stand: a march through New York in 2016 in memory of three black men shot dead by the police. Photograph: ddp USA/REX/Shutterstock

That incident gave birth to Thomas’s career as a writer. She wrote her first story, a piece of Mickey Mouse fan fiction, the same year. The story of Starr and Khalil was born more than a decade later when Thomas, who still lives in the same Georgetown neighbourhood, was in her senior year at a majority-white university in Jackson. In 2009, news broke that a 22-year-old, unarmed black man, Oscar Grant, had been detained and then shot in the back by police in California. Both the killing – which sparked protests at the time – but also the narrative around it angered Thomas deeply.

“One thing that stood out about Oscar was the way people talked about his past,” Thomas explained. “At school, people were talking about what he had done, that he may have deserved it, that he was in the wrong. But Oscar could have been any of the young men I get up with, who were maybe doing things they shouldn’t have been doing. They are all [seen as] thugs. They are put on trial sometimes, for their own death.”

I wanted Starr’s story to be as authentic as possible, and this is gonna sound odd, but I looked at Harry Potter

The Hate U Give follows Starr first as shocked and bereaved friend, then the naive and co-operative witness whose faith in the fairness of the process is cruelly betrayed. Finally, the 16-year-old evolves into a radicalised young black woman, keenly aware of the injustice of a system that regards the lives of poor black people as worth less than the white officers who appear to shoot them with impunity.

It’s a story Thomas feels it was imperative for the YA genre to grasp. “So many teenagers are affected by these cases. It’s usually young, unarmed black people who lose their lives,” she says, recalling a litany of the police killings that galvanised the Black Lives Matter movement. “Trayvon Martin was 17, Mike Brown was young, Tamir Rice was 12. And so young people are affected by it, possibly the most affected, because they’re seeing themselves.”

Even though The Hate U Give began as a short story in 2009, it was these deaths that inspired her, in 2015, to return to the subject and write a novel. At the time, she was secretary to a bishop in Mississippi. “I wrote while I was working,” Thomas explains, adding apologetically – “Yeah… All of those curse words were written in a church.” Previous attempts at getting her work published had come to nothing; a children’s book she wrote was met with 60 rejections by literary agents. But this time, things were different. Thomas contacted a nonprofit organisation, We Need Diverse Books, set up to do exactly what its name implies. Thomas submitted her work for the organisation’s inaugural awards, and won.

“It was a nice amount of money, enough for me to get a new laptop. My laptop at the time was held together with tape,” Thomas laughs. “And having a panel of judges like that – every single judge is big in the publishing industry – having them say this is good, was reassuring.”

‘It’s funny how much unity there is since this election’: Angie Thomas. Photograph: Nina Robinson for the Observer

Thomas supports the organisation, sharing their mission as well as mentoring young black people in Jackson and providing one to one support for those interested in writing. When she was young, Thomas felt a lack of black authors keenly, so although she hopes the book has universal appeal, nothing about it is watered down. Even the title is provocative, taken from interviews with the late rapper Tupac Shakur, who once said Thug Life – the name of his group and only studio album – stood for the phrase: “The Hate U Give Little Infants Fucks Everybody.”

Thomas, who dabbled in hip-hop herself, is a Tupac devotee. She also loves Jordan sneakers, The Fresh Prince of Bel Air and Harry Potter – and all these cultural references points combine to form, unsurprisingly, a unique kind of social commentary. “I wanted to make sure that I gave Starr’s story as authentically as possible, and this is probably gonna sound odd, but I looked at Harry Potter. One of the things JK Rowling does beautifully is that every person in Harry’s life, no matter their role, you can tell that they are the main character of their own story.”

People are more radicalised now. Trump’s attempt at division has actually made a lot of us come together

The commitment to authentic characters of all backgrounds has already been picked up by the reviews of The Hate U Give. But it’s Thomas’s Harry Potter gang theory that seems to have most awed fans at this Dallas book fair. “The Hogwarts houses are really gangs,” Thomas says. “They have their own colours, their own hideouts, and they are always riding for each other, like gangs. Harry, Ron and Hermione never snitch on each other, just like gangbangers. Death Eaters even have matching tattoos. And look at Voldemort. They’re scared to say his name. Really, that “He Who Shall Not Be Named” stuff is like giving him a street name. That’s some gangbanging right there.”

She laughs: “Tupac once said the biggest gangs in America are the politicians – Democrats and Republicans. They take the same approach some of these gangbangers take. It’s interesting how it’s only gangbanging though – that’s seen in such a negative light.”

These references are a device that Thomas uses to create empathy towards her characters – current and former gang members and drug dealers among them. But in doing so, she also lures in readers who would perhaps never otherwise encounter a sophisticated conversation about black identities and black consciousness. Starr, shuttling between a poor, black world at home and a privileged white world at school, is constantly “code-switching” – changing her speech and behaviour in an attempt to avoid being the token “ghetto black girl”, or another powerful stereotype: the “angry black woman”.

“I think a lot of African-Americans can understand that,” she says. “Especially if you’re put into a lot of white spaces – like me today,” she gestures at the conference hall around us. “You have to figure out who you are, where you are.”

Janelle Monáe (in red) and members of Wondaland chant the names of black Americans killed by US police in the Protest song Hell You Talmbout. Photograph: Pacific Press/LightRocket via Getty Images

It’s an interesting time to be conducting a discussion of blackness on such a high- profile literary stage. Thomas does not mince her words about the impact of President Trump, and singles out his attacks on the assertion of black identities in particular, such as his criticisms of the black comedy show Blackish, which he denounced on Twitter as “racism at its highest level”.

“So often blackness is seen in a negative light,” she laments. “The Black Lives Matter movement, which so often attracts the retort that “All Lives Matter”, has been conspicuously less high-profile since Trump’s election. But to Thomas – who’s a passionate supporter of the movement, although not formally affiliated to the Black Lives Matter organisation – that’s a question of evolution. “A lot of people involved in the Black Lives Matter movement are actually sticking up for those other lives. They are turning out for their Muslim brothers and sisters who are now being targeted. And where are you All Lives Matter people now? We are on the frontline, we are sticking up for them,” she says. “It’s funny how much unity there is since this election.”

Thomas says that when Trump was elected, she cried for 20 minutes before it occurred to her that a new unity would follow, and that the oppression and injustice she had always perceived, would now be more visible to everyone else in America. “The discomfort that everybody is feeling, I feel that I have always felt it. So it’s interesting to see people, you know, radicalised. They are energised. The attempt at division has actually made a lot of us come together, closer.”

It may be anecdotal, but here in Texas – a state so conservative that the most contentious political debate is not over whether to stop using the death penalty, but whether to restrict its use on the severely mentally ill –Thomas has hit a nerve. An endless stream of white teenagers, unable to get their hands on the now sold-out book, ask her to sign bookmarks, cloth book bags, even Post-it notes. “I just think that this book… is empowering,” says one 15-year-old fan, named Meghan, who is yet to read it but has heard about it on Tumblr. “Like I’ve really never seen anything like it.”

They smile at each other, this 15-year-old from the Dallas suburbs, with freckles and two wavy bunches, and Thomas, the black activist author, with her Thug Life fashion and Jordan 11s with red velvet trim. Then Thomas turns to me, a dreamy look in her eye, and says: “Isn’t this amazing?”