The Rise of Skywalker writing team wrote around cut scenes from The Force Awakens so that Carrie/Leia would be done justice. JJ Abrams initially wrote Billie's scenes without Carrie, but she told him, “I want to be in scenes with her. I want it for my children when I have kids. I want them to see.” Abrams said that at times Billie, who plays Lt. Connix, would get emotional and need to take a break.
Carrie also had scenes with other characters, where they matched the lighting and shot other angles just like in a normal re-shoot. Abrams said the process was a “bizarre kind of left side/right side of the brain sort of Venn diagram thing, of figuring out how to create the puzzle based on the pieces we had.” In the teaser you see Rey and Leia hugging, “and it’s like she gets to be in this movie where we would have wanted this moment.”