They are both correct. In those sentences "as" and "like" are prepositions and have the same meaning -- "in the same way as".
Kindly peruse the following sentences:
1. She began to dance like a professional dancer dances on the stage.
2. She began to dance as a professional dancer dances on the stage.
Which one of the above sentences is correct? Why?
I cannot understand how "as" and "like" in the above sentences may be preposition. Here they join two simple sentences and hence conjunction.