porting to reactjs