If your derailleur looks like this, with the claw facing the rear (to match the dropout), that will prevent you from replacing it with most available options. Some folding bikes are spec’d this way. Problem Solvers makes an adapter that MAY solve this problem (again, assuming you have this type of hanger), depending on the dropout:
https://problemsolversbike.com/produ...hain_tensioner