The monitors will only feed back if they are close enough to the microphone and the volume is turned up too loud.
You can use the monitors during recording. You can avoid feedback by turning down the volume or simply not routing the microphone through the monitors. With my current setup I have a few microphones pointing at a drum set. The microphones and my keyboard are routed through an audio interface. Only the keyboard goes through the main speakers, so there is no chance of feedback.
A bigger problem with using monitors while recording is that the sound from the monitors is picked up by the microphones. To get a cleaner recording, it is usually a good idea to use headphones where possible.
I usually use headphones while recording and switch back and forth between monitors and headphones when playing back, editing, and mixing.