If you want gains, it’s probably better to exercise in a fed state, as you can do more/go harder.
If you want longevity benefits (better fat burning, NAD+ boosting), it’s probably better to exercise in the fasted state.
But the difference is not that big. Just make sure that you DO exercise. :)
Small meal/snacks directly oppose the working principle of IF. (Bringing all your food intake into small time-spans, so that the body ‘sees’ the illusion of food being plentiful and refrains from down-regulating metabolism as in ‘starvation mode’.)