The F22 was designed in the 80s. It's old. It's fast, certainly the best in some aerodynamic ways, but nothing like the capability the JSF brings in computing technology.
In addition, the threats anticipated that led to its development never materialized.
In addition, the threats anticipated that led to its development never materialized.
That's why it was cancelled.