addded an onChange prop to be able to listen to change from a parent react element