Preheat the oven or air fryer to 180°C. Line a small baking tin with baking parchment.
Mash the bananas in a large bowl until smooth.
Add the chopped pineapple and mash lightly with a fork, leaving a little texture.
Stir in the egg, vanilla extract, ground ginger and poppy seeds, if using.
Add the oats, flour and coconut sugar, if using, and mix until well combined.
The mixture should be soft but not runny. If it seems too thick, add a splash of oat milk. If it is too wet, stir in a little extra oats or flour.
Leave the mixture to rest for 5 minutes so the oats can absorb some of the moisture.
Spoon the mixture into the prepared tin and spread it out evenly.
Bake for 15–20 minutes, or until lightly golden and set in the centre.
Leave to cool in the tin for a few minutes before transferring to a wire rack to cool completely.
Cut into bars or squares before serving.