Foam pots are often used in container gardening because they are convenient and provide excellent insulation for plant roots. It's crucial to consider the type of plant when choosing containers. Foam pots are typically made from polyethylene, not Styrofoam, an expanded polystyrene that can leach harmful chemicals into the potting mix over time.
While recycled Styrofoam containers can be a good choice for some plants, especially with added drainage holes, it's best to consider ornamental plants, not edibles. Our article on recommended containers for gardening does not include Styrofoam, and we at Bonnie Plants do not recommend its use.
Here is a link to the article that you may find helpful: Different Types of Pots & How they are Made | Bonnie Plants.