how does react work under the hood