The court announced it would hear challenges to state laws barring transgender athletes from girls’ and women’s sports.