It is recommended to dry plant parts under indirect sunlight in a well ventilated room. Direct sun light has negative effect on some plant constituents like antioxidants in addition to raising the temperature to high levels. In general it depends on the purpose and type of constituents that you are looking for.