A nanostructured nickel and cobalt fluoride catalyst is constructed by a facile strategy carried out in a mixture of ionic liquids under microwave irradiation followed by low temperature thermal-annealing. It is a novel and robust material among the non-noble metal catalysts towards the oxygen evolution reaction in water electrolysis.