Either can be used and neither is better than the other. If you have the opportunity to make a roux (fat plus flour) paste before adding the liquid, then use flour, but if adding at the end, cornstarch blended with a small amount of hot liquid, then tempered in, works better. Arrowroot and other gluten-free thickening agents can also be used.